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

* [Bug ipa/64153] [5.0 regression] r218205 miscompiles libgomp
  2014-12-02 14:52 [Bug ipa/64153] New: [5.0 regression] r218205 miscompiles libgomp schwab@linux-m68k.org
@ 2014-12-02 14:52 ` schwab@linux-m68k.org
  2014-12-02 14:54 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 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

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |5.0


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

* [Bug ipa/64153] [5.0 regression] r218205 miscompiles libgomp
  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
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-12-02 14:54 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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

* [Bug ipa/64153] [5.0 regression] r218205 miscompiles libgomp
  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
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jamborm at gcc dot gnu.org @ 2014-12-02 18:37 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-12-02
                 CC|                            |jamborm at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |jamborm at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Mine.


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

* [Bug ipa/64153] [5.0 regression] r218205 miscompiles libgomp
  2014-12-02 14:52 [Bug ipa/64153] New: [5.0 regression] r218205 miscompiles libgomp schwab@linux-m68k.org
                   ` (2 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jamborm at gcc dot gnu.org @ 2014-12-02 18:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Created attachment 34171
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34171&action=edit
Untested fix

I'm testing this fix - but on a x86_64-linux, together with other stuff, just
to be sure, I have debugged this only using a cross compiler, so any testing on
real affected hw is welcome.


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

* [Bug ipa/64153] [5.0 regression] r218205 miscompiles libgomp
  2014-12-02 14:52 [Bug ipa/64153] New: [5.0 regression] r218205 miscompiles libgomp schwab@linux-m68k.org
                   ` (3 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jamborm at gcc dot gnu.org @ 2014-12-02 20:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Martin Jambor <jamborm at gcc dot gnu.org> ---
I've posted the patch to the mailing list:

https://gcc.gnu.org/ml/gcc-patches/2014-12/msg00205.html


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

* [Bug ipa/64153] [5.0 regression] r218205 miscompiles libgomp
  2014-12-02 14:52 [Bug ipa/64153] New: [5.0 regression] r218205 miscompiles libgomp schwab@linux-m68k.org
                   ` (4 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: schwab@linux-m68k.org @ 2014-12-03 10:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andreas Schwab <schwab@linux-m68k.org> ---
This fixes all yesterday's testsuite regression.


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

* [Bug ipa/64153] [5.0 regression] r218205 miscompiles libgomp
  2014-12-02 14:52 [Bug ipa/64153] New: [5.0 regression] r218205 miscompiles libgomp schwab@linux-m68k.org
                   ` (5 preceding siblings ...)
  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
  8 siblings, 0 replies; 10+ messages in thread
From: jamborm at gcc dot gnu.org @ 2014-12-03 14:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Author: jamborm
Date: Wed Dec  3 14:05:51 2014
New Revision: 218316

URL: https://gcc.gnu.org/viewcvs?rev=218316&root=gcc&view=rev
Log:
2014-12-03  Martin Jambor  <mjambor@suse.cz>

    PR ipa/64153
    * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Check
    type sizes before view_converting.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa-inline-analysis.c


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

* [Bug ipa/64153] [5.0 regression] r218205 miscompiles libgomp
  2014-12-02 14:52 [Bug ipa/64153] New: [5.0 regression] r218205 miscompiles libgomp schwab@linux-m68k.org
                   ` (6 preceding siblings ...)
  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
  8 siblings, 0 replies; 10+ messages in thread
From: jamborm at gcc dot gnu.org @ 2014-12-03 15:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Author: jamborm
Date: Wed Dec  3 15:17:37 2014
New Revision: 218320

URL: https://gcc.gnu.org/viewcvs?rev=218320&root=gcc&view=rev
Log:
2014-12-03  Martin Jambor  <mjambor@suse.cz>

    PR ipa/64153
    * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Check
    type sizes before view_converting.


Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/ipa-inline-analysis.c


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

* [Bug ipa/64153] [5.0 regression] r218205 miscompiles libgomp
  2014-12-02 14:52 [Bug ipa/64153] New: [5.0 regression] r218205 miscompiles libgomp schwab@linux-m68k.org
                   ` (7 preceding siblings ...)
  2014-12-03 15:18 ` jamborm at gcc dot gnu.org
@ 2014-12-03 15:20 ` jamborm at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jamborm at gcc dot gnu.org @ 2014-12-03 15:20 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Martin Jambor <jamborm at gcc dot gnu.org> ---
(In reply to Andreas Schwab from comment #4)
> This fixes all yesterday's testsuite regression.

Thanks a lot.  I have committed the fix so this is now resolved.


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