]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR lto/60461 (LTO linking error at -Os (and above) on x86_64-linux-gnu)
authorMartin Jambor <mjambor@suse.cz>
Fri, 14 Mar 2014 10:49:05 +0000 (11:49 +0100)
committerMartin Jambor <jamborm@gcc.gnu.org>
Fri, 14 Mar 2014 10:49:05 +0000 (11:49 +0100)
2014-03-13  Martin Jambor  <mjambor@suse.cz>

PR lto/60461
* ipa-prop.c (ipa_modify_call_arguments): Fix iteration condition
and simplify it.

testsuite/
* gcc.dg/lto/pr60461_0.c: New test.

From-SVN: r208566

gcc/ChangeLog
gcc/ipa-prop.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/lto/pr60461_0.c [new file with mode: 0644]

index f20c9de4bf1868989705d89116e3fe3e12725fbd..b2c7072cc20465c3a5d88e561a2516ef609d61f2 100644 (file)
@@ -1,3 +1,9 @@
+2014-03-13  Martin Jambor  <mjambor@suse.cz>
+
+       PR lto/60461
+       * ipa-prop.c (ipa_modify_call_arguments): Fix iteration condition
+       and simplify it.
+
 2014-03-14  Georg-Johann Lay  <avr@gjlay.de>
 
        PR target/59396
index 4fb916aa01fdb9443630295bff0531523b233267..9f144fa3442818c8b2bd88a98630b7f09bd35b7f 100644 (file)
@@ -3900,8 +3900,7 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt,
       ipa_record_stmt_references (current_node, gsi_stmt (gsi));
       gsi_prev (&gsi);
     }
-  while ((gsi_end_p (prev_gsi) && !gsi_end_p (gsi))
-        || (!gsi_end_p (prev_gsi) && gsi_stmt (gsi) == gsi_stmt (prev_gsi)));
+  while (gsi_stmt (gsi) != gsi_stmt (prev_gsi));
 }
 
 /* If the expression *EXPR should be replaced by a reduction of a parameter, do
index 0268eb697106d14c7d6c4477eb3a2defe3152fa9..7f7c9743567f10b7e3d9782bc2d7f5a9f1cdffb3 100644 (file)
@@ -1,3 +1,8 @@
+2014-03-13  Martin Jambor  <mjambor@suse.cz>
+
+       PR lto/60461
+       * gcc.dg/lto/pr60461_0.c: New test.
+
 2014-03-14  Cesar Philippidis  <cesar@codesourcery.com>
 
        * lib/gcc-dg.exp (cleanup-saved-temps): Handle LTO temporaries.
diff --git a/gcc/testsuite/gcc.dg/lto/pr60461_0.c b/gcc/testsuite/gcc.dg/lto/pr60461_0.c
new file mode 100644 (file)
index 0000000..cad6a8d
--- /dev/null
@@ -0,0 +1,37 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-Os -flto} } } */
+
+
+struct S
+{
+  int f1;
+  int f2;
+} a[1] = { {0, 0} }; 
+
+int b, c;
+
+static unsigned short fn1 (struct S);
+
+void
+fn2 ()
+{
+  for (; c;)
+    ;
+  b = 0;
+  fn1 (a[0]);
+}
+
+unsigned short
+fn1 (struct S p)
+{
+  if (p.f1)
+    fn2 ();
+  return 0;
+}
+
+int
+main ()
+{
+  fn2 ();
+  return 0;
+}