This patch solves problem with FE first finalizing function and then adding
-fno-semantic-interposition flag (by parsing optimization attribute).
gcc/ChangeLog:
2022-04-09 Jan Hubicka <hubicka@ucw.cz>
PR ipa/103376
* cgraphunit.cc (cgraph_node::analyze): update semantic_interposition
flag.
gcc/testsuite/ChangeLog:
2022-04-09 Jan Hubicka <hubicka@ucw.cz>
PR ipa/103376
* gcc.c-torture/compile/pr103376.c: New test.
tree decl = this->decl;
location_t saved_loc = input_location;
input_location = DECL_SOURCE_LOCATION (decl);
+ semantic_interposition = opt_for_fn (decl, flag_semantic_interposition);
if (thunk)
{
--- /dev/null
+/* { dg-additional-options "-Ofast" } */
+__attribute__ ((optimize ("no-associative-math"))) double
+fn3 (double h, double l)
+{
+ return h + l;
+}
+
+double fn3 (double, double) __attribute__ ((optimize ("O2,no-associative-math")));
+