<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/test/CodeGen/fp-template.cpp, branch users/nico/python-2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[clang] Reset FP options before template instantiation</title>
<updated>2023-07-13T04:49:00+00:00</updated>
<author>
<name>Serge Pavlov</name>
<email>sepavloff@gmail.com</email>
</author>
<published>2023-07-13T04:49:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fde5924dcc69fe814085482df259b8cfee236f2c'/>
<id>fde5924dcc69fe814085482df259b8cfee236f2c</id>
<content type='text'>
AST nodes that may depend on FP options keep them as a difference
relative to the options outside the AST node. At the moment of
instantiation the FP options may be different from the default values,
defined by command-line option. In such case FP attributes would have
unexpected values. For example, the code:

    template &lt;class C&gt; void func_01(int last, C) {
      func_01(last, int());
    }
    void func_02() { func_01(0, 1); }
    #pragma STDC FENV_ACCESS ON

caused compiler crash, because template instantiation takes place at the
end of translation unit, where pragma STDC FENV_ACCESS is in effect. As
a result, code in the template instantiation would use constrained
intrinsics while the function does not have StrictFP attribute.

To solve this problem, FP attributes in Sema must be set to default
values, defined by command line options.

This change resolves https://github.com/llvm/llvm-project/issues/63542.

Differential Revision: https://reviews.llvm.org/D154359
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
AST nodes that may depend on FP options keep them as a difference
relative to the options outside the AST node. At the moment of
instantiation the FP options may be different from the default values,
defined by command-line option. In such case FP attributes would have
unexpected values. For example, the code:

    template &lt;class C&gt; void func_01(int last, C) {
      func_01(last, int());
    }
    void func_02() { func_01(0, 1); }
    #pragma STDC FENV_ACCESS ON

caused compiler crash, because template instantiation takes place at the
end of translation unit, where pragma STDC FENV_ACCESS is in effect. As
a result, code in the template instantiation would use constrained
intrinsics while the function does not have StrictFP attribute.

To solve this problem, FP attributes in Sema must be set to default
values, defined by command line options.

This change resolves https://github.com/llvm/llvm-project/issues/63542.

Differential Revision: https://reviews.llvm.org/D154359
</pre>
</div>
</content>
</entry>
<entry>
<title>[Clang] Reset FP options before function instantiations</title>
<updated>2023-07-05T09:34:19+00:00</updated>
<author>
<name>Serge Pavlov</name>
<email>sepavloff@gmail.com</email>
</author>
<published>2023-07-05T09:31:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2e903709de003dc6ae980197f4a0850a158dd9b8'/>
<id>2e903709de003dc6ae980197f4a0850a158dd9b8</id>
<content type='text'>
This is recommit of 98390ccb80569e8fbb20e6c996b4b8cff87fbec6, reverted
in 82a3969d710f5fb7a2ee4c9afadb648653923fef, because it caused
https://github.com/llvm/llvm-project/issues/63542. Although the problem
described in the issue is independent of the reverted patch, fail of
PCH/late-parsed-instantiations.cpp indeed obseved on PowerPC and is
likely to be caused by wrong serialization of `LateParsedTemplate`
objects. In this patch the serialization is fixed.

Original commit message is below.

Previously function template instantiations occurred with FP options
that were in effect at the end of translation unit. It was a problem
for late template parsing as these FP options were used as attributes of
AST nodes and may result in crash. To fix it FP options are set to the
state of the point of template definition.

Differential Revision: https://reviews.llvm.org/D143241
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is recommit of 98390ccb80569e8fbb20e6c996b4b8cff87fbec6, reverted
in 82a3969d710f5fb7a2ee4c9afadb648653923fef, because it caused
https://github.com/llvm/llvm-project/issues/63542. Although the problem
described in the issue is independent of the reverted patch, fail of
PCH/late-parsed-instantiations.cpp indeed obseved on PowerPC and is
likely to be caused by wrong serialization of `LateParsedTemplate`
objects. In this patch the serialization is fixed.

Original commit message is below.

Previously function template instantiations occurred with FP options
that were in effect at the end of translation unit. It was a problem
for late template parsing as these FP options were used as attributes of
AST nodes and may result in crash. To fix it FP options are set to the
state of the point of template definition.

Differential Revision: https://reviews.llvm.org/D143241
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[Clang] Reset FP options before function instantiations"</title>
<updated>2023-06-28T19:07:41+00:00</updated>
<author>
<name>Serge Pavlov</name>
<email>sepavloff@gmail.com</email>
</author>
<published>2023-06-28T19:04:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=82a3969d710f5fb7a2ee4c9afadb648653923fef'/>
<id>82a3969d710f5fb7a2ee4c9afadb648653923fef</id>
<content type='text'>
This reverts commit 98390ccb80569e8fbb20e6c996b4b8cff87fbec6.
It caused issue #63542.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 98390ccb80569e8fbb20e6c996b4b8cff87fbec6.
It caused issue #63542.
</pre>
</div>
</content>
</entry>
<entry>
<title>[Clang] Reset FP options before function instantiations</title>
<updated>2023-06-28T13:11:54+00:00</updated>
<author>
<name>Serge Pavlov</name>
<email>sepavloff@gmail.com</email>
</author>
<published>2023-06-28T13:11:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=98390ccb80569e8fbb20e6c996b4b8cff87fbec6'/>
<id>98390ccb80569e8fbb20e6c996b4b8cff87fbec6</id>
<content type='text'>
Previously function template instantiations occurred with FP options
that were in effect at the end of translation unit. It was a problem
for late template parsing as these FP options were used as attributes of
AST nodes and may result in crash. To fix it FP options are set to the
state of the point of template definition.

Differential Revision: https://reviews.llvm.org/D143241
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously function template instantiations occurred with FP options
that were in effect at the end of translation unit. It was a problem
for late template parsing as these FP options were used as attributes of
AST nodes and may result in crash. To fix it FP options are set to the
state of the point of template definition.

Differential Revision: https://reviews.llvm.org/D143241
</pre>
</div>
</content>
</entry>
<entry>
<title>[Clang] Copy strictfp attribute from pattern to instantiation</title>
<updated>2023-02-27T04:19:20+00:00</updated>
<author>
<name>Serge Pavlov</name>
<email>sepavloff@gmail.com</email>
</author>
<published>2023-02-27T04:19:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5cc91f977eaa0b0947ff1cf2a52ea6bc4479081d'/>
<id>5cc91f977eaa0b0947ff1cf2a52ea6bc4479081d</id>
<content type='text'>
If a template function contained a pragma that made it strictfp, code
generation for such function crashed, because the instantiation did not
have strictfp attribute. As a solution this attribute is copied from the
template to instantiation.

Differential Revision: https://reviews.llvm.org/D143919
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If a template function contained a pragma that made it strictfp, code
generation for such function crashed, because the instantiation did not
have strictfp attribute. As a solution this attribute is copied from the
template to instantiation.

Differential Revision: https://reviews.llvm.org/D143919
</pre>
</div>
</content>
</entry>
</feed>
