public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Patch to fix PR61360
@ 2014-09-18 16:04 Vladimir Makarov
  2014-09-18 16:10 ` Jakub Jelinek
  0 siblings, 1 reply; 6+ messages in thread
From: Vladimir Makarov @ 2014-09-18 16:04 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 435 bytes --]

The following patch fixes the PR.  The details can be found on

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61360

The patch was bootstrapped and tested on x86/x86-64.

Committed as rev. 215358.

2014-09-18  Vladimir Makarov  <vmakarov@redhat.com>

        PR target/61360
        * lra.c (lra): Call recog_init.

2014-09-18  Vladimir Makarov  <vmakarov@redhat.com>

        PR target/61360
        * gcc.target/i386/pr61360.c: New.


[-- Attachment #2: pr61360.patch --]
[-- Type: text/x-patch, Size: 1063 bytes --]

Index: lra.c
===================================================================
--- lra.c	(revision 215337)
+++ lra.c	(working copy)
@@ -2135,6 +2135,11 @@ lra (FILE *f)
 
   lra_in_progress = 1;
 
+  /* The enable attributes can change their values as LRA starts
+     although it is a bad practice.  To prevent reuse of the outdated
+     values, clear them.  */
+  recog_init ();
+
   lra_live_range_iter = lra_coalesce_iter = 0;
   lra_constraint_iter = lra_constraint_iter_after_spill = 0;
   lra_inheritance_iter = lra_undo_inheritance_iter = 0;
Index: testsuite/gcc.target/i386/pr61360.c
===================================================================
--- testsuite/gcc.target/i386/pr61360.c	(revision 0)
+++ testsuite/gcc.target/i386/pr61360.c	(working copy)
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-march=amdfam10 -O2" } */
+int a, b, c, e, f, g, h;
+long *d;
+__attribute__((cold)) void fn1() {
+  int i = g | 1;
+  for (; g; h++) {
+    for (; a; e++) d[0] = c;
+    if (0.002 * i) break;
+    for (; b; f++) d[h] = 0;
+  }
+}

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-09-18 21:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-18 16:04 Patch to fix PR61360 Vladimir Makarov
2014-09-18 16:10 ` Jakub Jelinek
2014-09-18 16:53   ` Vladimir Makarov
2014-09-18 17:36   ` Richard Sandiford
2014-09-18 18:10     ` Vladimir Makarov
2014-09-18 21:50       ` Richard Sandiford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).