public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/64153] New: [5.0 regression] r218205 miscompiles libgomp
@ 2014-12-02 14:52 schwab@linux-m68k.org
  2014-12-02 14:52 ` [Bug ipa/64153] " schwab@linux-m68k.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: schwab@linux-m68k.org @ 2014-12-02 14:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64153
           Summary: [5.0 regression] r218205 miscompiles libgomp
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: schwab@linux-m68k.org
                CC: mjambor at suse dot cz
            Blocks: 63551
            Target: m68k-*-*

Created attachment 34164
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34164&action=edit
reduced testcase

The attached testcase it reduced from libgomp/env.c.  When compiled with -O2 it
misoptimizes "if (task)" to 1, losing the call to gomp_new_icv.

--- env.s.good
+++ env.s.bad    2014-12-02 15:29:50.135924092 +0100
@@ -12,26 +12,18 @@ omp_set_num_threads:
     jsr __m68k_read_tp
     add.l gomp_tls_data@TLSIE(%a5),%a0
     move.l (%a0),%a0
-    tst.l %a0
-    jeq .L7
     move.l 8(%fp),%d0
-    jle .L8
-.L4:
+    jle .L5
     move.l %d0,(%a0)
     move.l -4(%fp),%a5
     unlk %fp
     rts
-.L8:
+.L5:
     moveq #1,%d0
     move.l %d0,(%a0)
     move.l -4(%fp),%a5
     unlk %fp
     rts
-.L7:
-    jsr gomp_new_icv
-    move.l 8(%fp),%d0
-    jgt .L4
-    jra .L8
     .size    omp_set_num_threads, .-omp_set_num_threads
     .align    2
     .globl    omp_set_dynamic
@@ -43,17 +35,6 @@ omp_set_dynamic:
     jsr __m68k_read_tp
     add.l gomp_tls_data@TLSIE(%a5),%a0
     move.l (%a0),%a0
-    tst.l %a0
-    jeq .L14
-    tst.l 8(%fp)
-    sne %d0
-    neg.b %d0
-    move.b %d0,4(%a0)
-    move.l -4(%fp),%a5
-    unlk %fp
-    rts
-.L14:
-    jsr gomp_new_icv
     tst.l 8(%fp)
     sne %d0
     neg.b %d0


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

end of thread, other threads:[~2014-12-03 15:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-02 14:52 [Bug ipa/64153] New: [5.0 regression] r218205 miscompiles libgomp schwab@linux-m68k.org
2014-12-02 14:52 ` [Bug ipa/64153] " schwab@linux-m68k.org
2014-12-02 14:54 ` rguenth at gcc dot gnu.org
2014-12-02 18:37 ` jamborm at gcc dot gnu.org
2014-12-02 18:43 ` jamborm at gcc dot gnu.org
2014-12-02 20:33 ` jamborm at gcc dot gnu.org
2014-12-03 10:34 ` schwab@linux-m68k.org
2014-12-03 14:06 ` jamborm at gcc dot gnu.org
2014-12-03 15:18 ` jamborm at gcc dot gnu.org
2014-12-03 15:20 ` jamborm at gcc dot gnu.org

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).