public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug regression/45623]  New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
@ 2010-09-09 21:45 tglek at mozilla dot com
  2010-09-09 22:03 ` [Bug target/45623] " dwitte at mozilla dot com
                   ` (29 more replies)
  0 siblings, 30 replies; 31+ messages in thread
From: tglek at mozilla dot com @ 2010-09-09 21:45 UTC (permalink / raw)
  To: gcc-bugs

See https://bugzilla.mozilla.org/show_bug.cgi?id=594611 and
https://bugzilla.mozilla.org/show_bug.cgi?id=590683
 for more details. This breaks users of Firefox Sync on GCC 4.5. 
The bug isn't present in gcc 4.4 or trunk. What would it take to cherry-pick a
fix for 4.5.x?


-- 
           Summary: GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
           Product: gcc
           Version: 4.5.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: regression
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tglek at mozilla dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug target/45623] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
@ 2010-09-09 22:03 ` dwitte at mozilla dot com
  2010-09-09 22:18 ` pinskia at gcc dot gnu dot org
                   ` (28 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: dwitte at mozilla dot com @ 2010-09-09 22:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from dwitte at mozilla dot com  2010-09-09 22:03 -------
FWIW our libffi is basically libffi git head: http://github.com/atgreen/libffi

Which is regularly synced to gcc libffi.


-- 

dwitte at mozilla dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dwitte at mozilla dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug target/45623] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
  2010-09-09 22:03 ` [Bug target/45623] " dwitte at mozilla dot com
@ 2010-09-09 22:18 ` pinskia at gcc dot gnu dot org
  2010-09-10  0:38 ` hjl dot tools at gmail dot com
                   ` (27 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-09-09 22:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2010-09-09 22:17 -------
There have been no ABI changes in 4.5 that I know of for PowerPC64 or even
differences between the trunk and 4.5.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug target/45623] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
  2010-09-09 22:03 ` [Bug target/45623] " dwitte at mozilla dot com
  2010-09-09 22:18 ` pinskia at gcc dot gnu dot org
@ 2010-09-10  0:38 ` hjl dot tools at gmail dot com
  2010-09-10  0:46 ` dwitte at mozilla dot com
                   ` (26 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-09-10  0:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from hjl dot tools at gmail dot com  2010-09-10 00:38 -------
Mozilla bugs say "Platform: x86 Linux". But gcc bug says
"powerpc64-*-linux". What is going on?


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl dot tools at gmail dot
                   |                            |com
             Status|UNCONFIRMED                 |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug target/45623] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (2 preceding siblings ...)
  2010-09-10  0:38 ` hjl dot tools at gmail dot com
@ 2010-09-10  0:46 ` dwitte at mozilla dot com
  2010-09-10  0:52 ` hjl dot tools at gmail dot com
                   ` (25 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: dwitte at mozilla dot com @ 2010-09-10  0:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from dwitte at mozilla dot com  2010-09-10 00:46 -------
This is on x86_64. (I can't change the field, though. Can someone else?)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug target/45623] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (3 preceding siblings ...)
  2010-09-10  0:46 ` dwitte at mozilla dot com
@ 2010-09-10  0:52 ` hjl dot tools at gmail dot com
  2010-09-10  1:41 ` pinskia at gcc dot gnu dot org
                   ` (24 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-09-10  0:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from hjl dot tools at gmail dot com  2010-09-10 00:51 -------
I am not ware any x86-64 psABI changes in gcc 4.5. Please provide
a testcase.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug target/45623] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (4 preceding siblings ...)
  2010-09-10  0:52 ` hjl dot tools at gmail dot com
@ 2010-09-10  1:41 ` pinskia at gcc dot gnu dot org
  2010-09-10  2:37 ` tglek at mozilla dot com
                   ` (23 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-09-10  1:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2010-09-10 01:40 -------
(In reply to comment #3)
> Mozilla bugs say "Platform: x86 Linux". But gcc bug says
> "powerpc64-*-linux". What is going on?

I must have missed since I saw Linux64 I was thinking powerpc64 :).  Really
there have been none x86_64 ones either.  Though the normal thing here that
might happen is strict aliasing issues.  Can you try -fno-strict-aliasing. 
Also maybe look for buffer overflows which might cause issues you think are
compiler related.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug target/45623] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (5 preceding siblings ...)
  2010-09-10  1:41 ` pinskia at gcc dot gnu dot org
@ 2010-09-10  2:37 ` tglek at mozilla dot com
  2010-09-10  2:57 ` hjl dot tools at gmail dot com
                   ` (22 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: tglek at mozilla dot com @ 2010-09-10  2:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from tglek at mozilla dot com  2010-09-10 02:37 -------
-fno-strict-aliasing makes no difference.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug target/45623] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (6 preceding siblings ...)
  2010-09-10  2:37 ` tglek at mozilla dot com
@ 2010-09-10  2:57 ` hjl dot tools at gmail dot com
  2010-09-15 11:45 ` mh+gcc at glandium dot org
                   ` (21 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-09-10  2:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from hjl dot tools at gmail dot com  2010-09-10 02:56 -------
(In reply to comment #0)
> See https://bugzilla.mozilla.org/show_bug.cgi?id=594611 and
> https://bugzilla.mozilla.org/show_bug.cgi?id=590683
>  for more details. This breaks users of Firefox Sync on GCC 4.5. 
> The bug isn't present in gcc 4.4 or trunk. What would it take to cherry-pick a
> fix for 4.5.x?
> 

You either identify which checkin fixes it or find a testcase so that
I can use it to find the fix.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug target/45623] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (7 preceding siblings ...)
  2010-09-10  2:57 ` hjl dot tools at gmail dot com
@ 2010-09-15 11:45 ` mh+gcc at glandium dot org
  2010-09-15 11:53 ` mh+gcc at glandium dot org
                   ` (20 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: mh+gcc at glandium dot org @ 2010-09-15 11:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from mh+gcc at glandium dot org  2010-09-15 11:45 -------
Created an attachment (id=21798)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21798&action=view)
Reduced testcase

Both issues Taras mentioned are actually separated. One is an actual bug in ffi
(to be filed), the other one is an optimization issue with gcc. I reduced the
problematic code to the attached code, which prints "foo" with -O1 (and more),
and "bar" with -O0, with gcc 4.5.1. gcc 4.4 compiled code correctly prints
"bar" with any optimization level.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug target/45623] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (8 preceding siblings ...)
  2010-09-15 11:45 ` mh+gcc at glandium dot org
@ 2010-09-15 11:53 ` mh+gcc at glandium dot org
  2010-09-15 12:05 ` mh+gcc at glandium dot org
                   ` (19 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: mh+gcc at glandium dot org @ 2010-09-15 11:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from mh+gcc at glandium dot org  2010-09-15 11:53 -------
Please note this actually only happens on x86. (I would change the summary and
target if I could)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug target/45623] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (9 preceding siblings ...)
  2010-09-15 11:53 ` mh+gcc at glandium dot org
@ 2010-09-15 12:05 ` mh+gcc at glandium dot org
  2010-09-15 12:12 ` mh+gcc at glandium dot org
                   ` (18 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: mh+gcc at glandium dot org @ 2010-09-15 12:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from mh+gcc at glandium dot org  2010-09-15 12:05 -------
Created an attachment (id=21799)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21799&action=view)
Reduced testcase

Inlining JSVAL_TO_PRIVATE by hand still makes it break, and reduces the
testcase further.


-- 

mh+gcc at glandium dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #21798|0                           |1
        is obsolete|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug target/45623] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (10 preceding siblings ...)
  2010-09-15 12:05 ` mh+gcc at glandium dot org
@ 2010-09-15 12:12 ` mh+gcc at glandium dot org
  2010-09-15 12:16 ` rguenth at gcc dot gnu dot org
                   ` (17 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: mh+gcc at glandium dot org @ 2010-09-15 12:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from mh+gcc at glandium dot org  2010-09-15 12:11 -------
FWIW, it's still broken on a gcc trunk snapshot from the 28th of august.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug target/45623] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (11 preceding siblings ...)
  2010-09-15 12:12 ` mh+gcc at glandium dot org
@ 2010-09-15 12:16 ` rguenth at gcc dot gnu dot org
  2010-09-15 12:31 ` [Bug tree-optimization/45623] [4.5/4.6 Regression] " rguenth at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-15 12:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from rguenth at gcc dot gnu dot org  2010-09-15 12:16 -------
Confirmed and investigating.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-09-15 12:16:05
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug tree-optimization/45623] [4.5/4.6 Regression] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (12 preceding siblings ...)
  2010-09-15 12:16 ` rguenth at gcc dot gnu dot org
@ 2010-09-15 12:31 ` rguenth at gcc dot gnu dot org
  2010-09-15 12:47 ` mh+gcc at glandium dot org
                   ` (15 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-15 12:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from rguenth at gcc dot gnu dot org  2010-09-15 12:31 -------
You are accessing a pointer of type char *s1 via an lvalue of type void *
(*data).  Or speaking in C++, you are accessing an object of dynamic type
void * (stored to via *data) by an lvalue of type char * (s1).

Thus your testcase invokes undefined behavior.

That it is miscompiled at -O1 is a bug.

With GCC 4.6 we now assign the same alias-set to all pointers, hiding
this issue.

data_4 is a non-pointer variable,ignoring constraint:*data_4 = s2.1_5
data_4, points-to vars: { }

oops.  I will have a look at the points-to bug.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
          Component|target                      |tree-optimization
           Keywords|                            |wrong-code
   Last reconfirmed|2010-09-15 12:16:05         |2010-09-15 12:31:16
               date|                            |
            Summary|GCC 4.5.[01] breaks our ffi |[4.5/4.6 Regression] GCC
                   |on Linux64. ABI break?      |4.5.[01] breaks our ffi on
                   |                            |Linux64. ABI break?
   Target Milestone|---                         |4.5.2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug tree-optimization/45623] [4.5/4.6 Regression] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (13 preceding siblings ...)
  2010-09-15 12:31 ` [Bug tree-optimization/45623] [4.5/4.6 Regression] " rguenth at gcc dot gnu dot org
@ 2010-09-15 12:47 ` mh+gcc at glandium dot org
  2010-09-15 12:52 ` mh+gcc at glandium dot org
                   ` (14 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: mh+gcc at glandium dot org @ 2010-09-15 12:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from mh+gcc at glandium dot org  2010-09-15 12:47 -------
Note that the original code doesn't use char *. I used char * to make it easily
visible with a printf. Actually, just writing

void foo(jsval_layout l, void *s2) {
    jsval_layout m;
    m.asBits = l.asBits;
    void ** data = (void**)m.ptr; 
    *data = s2;
}

exhibits the problem, afaics.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug tree-optimization/45623] [4.5/4.6 Regression] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (14 preceding siblings ...)
  2010-09-15 12:47 ` mh+gcc at glandium dot org
@ 2010-09-15 12:52 ` mh+gcc at glandium dot org
  2010-09-15 13:04 ` rguenth at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: mh+gcc at glandium dot org @ 2010-09-15 12:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from mh+gcc at glandium dot org  2010-09-15 12:52 -------
The real code where this gets problematic:
http://mxr.mozilla.org/mozilla-central/source/js/src/ctypes/CTypes.cpp#5615

The function it calls:
http://mxr.mozilla.org/mozilla-central/source/js/src/ctypes/CTypes.cpp#5542
http://mxr.mozilla.org/mozilla-central/source/js/src/jsapi.h#281
http://mxr.mozilla.org/mozilla-central/source/js/src/jsval.h#799
http://mxr.mozilla.org/mozilla-central/source/js/src/jsval.h#506


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug tree-optimization/45623] [4.5/4.6 Regression] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (15 preceding siblings ...)
  2010-09-15 12:52 ` mh+gcc at glandium dot org
@ 2010-09-15 13:04 ` rguenth at gcc dot gnu dot org
  2010-09-15 13:14 ` mh+gcc at glandium dot org
                   ` (12 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-15 13:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from rguenth at gcc dot gnu dot org  2010-09-15 13:03 -------
points-to analysis does not honor GCCs type-punning through union extension
(it works on x86_64 because ptr and asBits match in size and thus SRA
cleans the code up before pointer-analysis).  So PTA sees

  ss1.0_1 = ss1;
  l.ptr = ss1.0_1;
  D.3244_2 = l.asBits;
  m.asBits = D.3244_2;
  D.3245_3 = m.ptr;
  data_4 = (void * *) D.3245_3;

and it considers both D.3244_2 = l.asBits and m.asBits = D.3244_2 as
irrelevant (as they do not involve pointers).  Thus, m.ptr is never
assigned to and the points-to set of data_4 ends up as empty which
makes us remove the store *data_4 = s2.1_5.

Thus, as a workaround you should make sure the asBits field matches
pointer-size (so for example use uintptr_t isntead of uint64_t).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug tree-optimization/45623] [4.5/4.6 Regression] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (16 preceding siblings ...)
  2010-09-15 13:04 ` rguenth at gcc dot gnu dot org
@ 2010-09-15 13:14 ` mh+gcc at glandium dot org
  2010-09-15 13:25 ` rguenth at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: mh+gcc at glandium dot org @ 2010-09-15 13:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from mh+gcc at glandium dot org  2010-09-15 13:14 -------
(In reply to comment #17)
> Thus, as a workaround you should make sure the asBits field matches
> pointer-size (so for example use uintptr_t isntead of uint64_t).

which is not possible in the original code, as the union is a bit more
complicated than in the reduced testcase:
http://mxr.mozilla.org/mozilla-central/source/js/src/jsval.h#274


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug tree-optimization/45623] [4.5/4.6 Regression] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (17 preceding siblings ...)
  2010-09-15 13:14 ` mh+gcc at glandium dot org
@ 2010-09-15 13:25 ` rguenth at gcc dot gnu dot org
  2010-09-15 13:41 ` mh+gcc at glandium dot org
                   ` (10 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-15 13:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from rguenth at gcc dot gnu dot org  2010-09-15 13:24 -------
Another workaround is to use -fno-tree-pta.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug tree-optimization/45623] [4.5/4.6 Regression] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (18 preceding siblings ...)
  2010-09-15 13:25 ` rguenth at gcc dot gnu dot org
@ 2010-09-15 13:41 ` mh+gcc at glandium dot org
  2010-09-15 13:50 ` rguenth at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: mh+gcc at glandium dot org @ 2010-09-15 13:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from mh+gcc at glandium dot org  2010-09-15 13:41 -------
(In reply to comment #19)
> Another workaround is to use -fno-tree-pta.

Doesn't work here.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug tree-optimization/45623] [4.5/4.6 Regression] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (19 preceding siblings ...)
  2010-09-15 13:41 ` mh+gcc at glandium dot org
@ 2010-09-15 13:50 ` rguenth at gcc dot gnu dot org
  2010-09-15 13:52 ` mh+gcc at glandium dot org
                   ` (8 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-15 13:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #21 from rguenth at gcc dot gnu dot org  2010-09-15 13:50 -------
(In reply to comment #20)
> (In reply to comment #19)
> > Another workaround is to use -fno-tree-pta.
> 
> Doesn't work here.

For the original code?  Then your reduced testcase is different from the
original problem.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug tree-optimization/45623] [4.5/4.6 Regression] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (20 preceding siblings ...)
  2010-09-15 13:50 ` rguenth at gcc dot gnu dot org
@ 2010-09-15 13:52 ` mh+gcc at glandium dot org
  2010-09-15 13:56 ` rguenther at suse dot de
                   ` (7 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: mh+gcc at glandium dot org @ 2010-09-15 13:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #22 from mh+gcc at glandium dot org  2010-09-15 13:52 -------
(In reply to comment #21)
> For the original code?  Then your reduced testcase is different from the
> original problem.

It doesn't work for the reduced testcase here, with gcc 4.5.1


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug tree-optimization/45623] [4.5/4.6 Regression] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (21 preceding siblings ...)
  2010-09-15 13:52 ` mh+gcc at glandium dot org
@ 2010-09-15 13:56 ` rguenther at suse dot de
  2010-09-15 13:59 ` rguenth at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: rguenther at suse dot de @ 2010-09-15 13:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #23 from rguenther at suse dot de  2010-09-15 13:56 -------
Subject: Re:  [4.5/4.6 Regression] GCC 4.5.[01]
 breaks our ffi on Linux64. ABI break?

On Wed, 15 Sep 2010, mh+gcc at glandium dot org wrote:

> ------- Comment #22 from mh+gcc at glandium dot org  2010-09-15 13:52 -------
> (In reply to comment #21)
> > For the original code?  Then your reduced testcase is different from the
> > original problem.
> 
> It doesn't work for the reduced testcase here, with gcc 4.5.1

It does fix the PTA problem (thus makes it work at -O1).  Still
fails at -O2 for some reason (but can't reproduce that on
the tip of the branch, only with the 4.5.1 release).  Alias-correct 
testcase:

#include <stdint.h>

extern void abort (void);

char *s1 = "foo";
char *s2 = "bar";

char **ss1 = &s1;

typedef union jsval_layout
{
    uint64_t asBits;
    char **ptr;
} jsval_layout;

int main()
{
  jsval_layout l, m;
  l.ptr = ss1;
  m.asBits = l.asBits;
  char ** data = m.ptr;
  *data = s2;
  if (s1 != s2)
    abort ();
  return 0;
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug tree-optimization/45623] [4.5/4.6 Regression] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (22 preceding siblings ...)
  2010-09-15 13:56 ` rguenther at suse dot de
@ 2010-09-15 13:59 ` rguenth at gcc dot gnu dot org
  2010-09-15 14:01 ` mh+gcc at glandium dot org
                   ` (5 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-15 13:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #24 from rguenth at gcc dot gnu dot org  2010-09-15 13:59 -------
Created an attachment (id=21801)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21801&action=view)
patch

I am testing this patch (for 4.5 branch).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug tree-optimization/45623] [4.5/4.6 Regression] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (23 preceding siblings ...)
  2010-09-15 13:59 ` rguenth at gcc dot gnu dot org
@ 2010-09-15 14:01 ` mh+gcc at glandium dot org
  2010-09-16 11:06 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: mh+gcc at glandium dot org @ 2010-09-15 14:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #25 from mh+gcc at glandium dot org  2010-09-15 14:01 -------
Oh, I was trying with -O2, yes, it works with -O1 -fno-tree-pta. Let me try on
the original code, too.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug tree-optimization/45623] [4.5/4.6 Regression] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (24 preceding siblings ...)
  2010-09-15 14:01 ` mh+gcc at glandium dot org
@ 2010-09-16 11:06 ` rguenth at gcc dot gnu dot org
  2010-09-16 11:07 ` [Bug tree-optimization/45623] [4.5 " rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-16 11:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #26 from rguenth at gcc dot gnu dot org  2010-09-16 11:06 -------
Subject: Bug 45623

Author: rguenth
Date: Thu Sep 16 11:06:25 2010
New Revision: 164333

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164333
Log:
2010-09-16  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/45623
        * tree-ssa-structalias.c (get_constraint_for_ptr_offset): Adjust.
        (get_constraint_for_component_ref): If computing a constraint
        for the rhs handle type punning through unions.
        (get_constraint_for_address_of): Adjust.
        (get_constraint_for_1): Likewise.
        (get_constraint_for): Likewise.
        (get_constraint_for_rhs): New function.
        (do_structure_copy): Adjust.
        (make_constraint_to): Likewise.
        (handle_const_call): Likewise.
        (find_func_aliases): Likewise.
        (process_ipa_clobber): Likewise.
        (create_variable_info_for): Likewise.

        * gcc.dg/torture/pr45623.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr45623.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-structalias.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug tree-optimization/45623] [4.5 Regression] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (25 preceding siblings ...)
  2010-09-16 11:06 ` rguenth at gcc dot gnu dot org
@ 2010-09-16 11:07 ` rguenth at gcc dot gnu dot org
  2010-09-17  9:09 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-16 11:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #27 from rguenth at gcc dot gnu dot org  2010-09-16 11:07 -------
Fixed for trunk sofar.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.6.0
            Summary|[4.5/4.6 Regression] GCC    |[4.5 Regression] GCC
                   |4.5.[01] breaks our ffi on  |4.5.[01] breaks our ffi on
                   |Linux64. ABI break?         |Linux64. ABI break?


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug tree-optimization/45623] [4.5 Regression] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (26 preceding siblings ...)
  2010-09-16 11:07 ` [Bug tree-optimization/45623] [4.5 " rguenth at gcc dot gnu dot org
@ 2010-09-17  9:09 ` rguenth at gcc dot gnu dot org
  2010-09-20  8:34 ` rguenth at gcc dot gnu dot org
  2010-09-20  8:34 ` rguenth at gcc dot gnu dot org
  29 siblings, 0 replies; 31+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-17  9:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #29 from rguenth at gcc dot gnu dot org  2010-09-17 09:09 -------
(In reply to comment #28)
> (In reply to comment #27)
> > Fixed for trunk sofar.
> 
> Is there an eta for 4.5 backport? We need this to switch Firefox to 4.5 on
> Linux.

I just want to play safe and see if there is any fallout on trunk.  You can
use the attachment in comment #24 for the 4.5 branch (and I'd appreciate
testing if this fixes your original problem)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug tree-optimization/45623] [4.5 Regression] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (28 preceding siblings ...)
  2010-09-20  8:34 ` rguenth at gcc dot gnu dot org
@ 2010-09-20  8:34 ` rguenth at gcc dot gnu dot org
  29 siblings, 0 replies; 31+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-20  8:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #30 from rguenth at gcc dot gnu dot org  2010-09-20 08:33 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Known to fail|                            |4.5.1
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

* [Bug tree-optimization/45623] [4.5 Regression] GCC 4.5.[01] breaks our ffi on Linux64. ABI break?
  2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
                   ` (27 preceding siblings ...)
  2010-09-17  9:09 ` rguenth at gcc dot gnu dot org
@ 2010-09-20  8:34 ` rguenth at gcc dot gnu dot org
  2010-09-20  8:34 ` rguenth at gcc dot gnu dot org
  29 siblings, 0 replies; 31+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-20  8:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #31 from rguenth at gcc dot gnu dot org  2010-09-20 08:34 -------
Subject: Bug 45623

Author: rguenth
Date: Mon Sep 20 08:33:46 2010
New Revision: 164430

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164430
Log:
2010-09-20  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/45623
        * tree-ssa-structalias.c (get_constraint_for_ptr_offset): Adjust.
        (get_constraint_for_component_ref): If computing a constraint
        for the rhs handle type punning through unions.
        (get_constraint_for_address_of): Adjust.
        (get_constraint_for_1): Likewise.
        (get_constraint_for): Likewise.
        (get_constraint_for_rhs): New function.
        (do_structure_copy): Adjust.
        (make_constraint_to): Likewise.
        (handle_const_call): Likewise.
        (find_func_aliases): Likewise.

        * gcc.dg/torture/pr45623.c: New testcase.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/gcc.dg/torture/pr45623.c
Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_5-branch/gcc/tree-ssa-structalias.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45623


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

end of thread, other threads:[~2010-09-20  8:34 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-09 21:45 [Bug regression/45623] New: GCC 4.5.[01] breaks our ffi on Linux64. ABI break? tglek at mozilla dot com
2010-09-09 22:03 ` [Bug target/45623] " dwitte at mozilla dot com
2010-09-09 22:18 ` pinskia at gcc dot gnu dot org
2010-09-10  0:38 ` hjl dot tools at gmail dot com
2010-09-10  0:46 ` dwitte at mozilla dot com
2010-09-10  0:52 ` hjl dot tools at gmail dot com
2010-09-10  1:41 ` pinskia at gcc dot gnu dot org
2010-09-10  2:37 ` tglek at mozilla dot com
2010-09-10  2:57 ` hjl dot tools at gmail dot com
2010-09-15 11:45 ` mh+gcc at glandium dot org
2010-09-15 11:53 ` mh+gcc at glandium dot org
2010-09-15 12:05 ` mh+gcc at glandium dot org
2010-09-15 12:12 ` mh+gcc at glandium dot org
2010-09-15 12:16 ` rguenth at gcc dot gnu dot org
2010-09-15 12:31 ` [Bug tree-optimization/45623] [4.5/4.6 Regression] " rguenth at gcc dot gnu dot org
2010-09-15 12:47 ` mh+gcc at glandium dot org
2010-09-15 12:52 ` mh+gcc at glandium dot org
2010-09-15 13:04 ` rguenth at gcc dot gnu dot org
2010-09-15 13:14 ` mh+gcc at glandium dot org
2010-09-15 13:25 ` rguenth at gcc dot gnu dot org
2010-09-15 13:41 ` mh+gcc at glandium dot org
2010-09-15 13:50 ` rguenth at gcc dot gnu dot org
2010-09-15 13:52 ` mh+gcc at glandium dot org
2010-09-15 13:56 ` rguenther at suse dot de
2010-09-15 13:59 ` rguenth at gcc dot gnu dot org
2010-09-15 14:01 ` mh+gcc at glandium dot org
2010-09-16 11:06 ` rguenth at gcc dot gnu dot org
2010-09-16 11:07 ` [Bug tree-optimization/45623] [4.5 " rguenth at gcc dot gnu dot org
2010-09-17  9:09 ` rguenth at gcc dot gnu dot org
2010-09-20  8:34 ` rguenth at gcc dot gnu dot org
2010-09-20  8:34 ` rguenth at gcc dot gnu dot 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).