public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/44095]  New: [4.5/4.6 regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux
@ 2010-05-12 11:00 mikpe at it dot uu dot se
  2010-05-12 11:35 ` [Bug java/44095] " rguenth at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: mikpe at it dot uu dot se @ 2010-05-12 11:00 UTC (permalink / raw)
  To: java-prs

Java is severely broken on sparc64-linux with gcc 4.5/4.6, which is a major
regression from 4.4:

http://gcc.gnu.org/ml/gcc-testresults/2010-05/msg00853.html (4.6 broken)
http://gcc.gnu.org/ml/gcc-testresults/2010-05/msg00681.html (4.5 broken)
http://gcc.gnu.org/ml/gcc-testresults/2010-05/msg00472.html (4.4 works)

The detailed test suite logs show that _every_ -findirect-dispatch test case
SEGFAULTs shortly after startup.

I've bisected trunk and identified r155622 as the cause:

Author: jakub
Date: Mon Jan  4 16:02:41 2010
New Revision: 155622

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155622
Log:
        PR driver/42442
        * gcc.c (SWITCH_IGNORE_PERMANENTLY): Define.
        (do_self_spec): For switches with SWITCH_IGNORE set set also
        SWITCH_IGNORE_PERMANENTLY.
        (check_live_switch): Check SWITCH_IGNORE_PERMANENTLY instead
        of SWITCH_IGNORE.

Let's compare installations of r155621 and r155622:

> LD_LIBRARY_PATH=/mnt/scratch/install-r155621/lib: /mnt/scratch/install-r155621/bin/gcj -v -findirect-dispatch --main=ArrayStore2 ArrayStore2.jar
...
 /mnt/scratch/install-r155621/libexec/gcc/sparc64-unknown-linux-gnu/4.5.0/jc1
ArrayStore2.jar -fuse-divide-subroutine -fuse-boehm-gc -fnon-call-exceptions
-fPIC -fkeep-inline-functions -quiet -dumpbase ArrayStore2.jar -mcpu=v8
-auxbase ArrayStore2 -g1 -version -findirect-dispatch
-fbootclasspath=./:/mnt/scratch/install-r155621/share/java/libgcj-4.5.0.jar -o
/tmp/ccCkBmCp.s
...
 as -V -Qy -s -K PIC -32 -relax -o /tmp/ccgzZvpI.o /tmp/ccCkBmCp.s
...

/mnt/scratch/install-r155621/libexec/gcc/sparc64-unknown-linux-gnu/4.5.0/jvgenmain
-findirect-dispatch ArrayStore2main /tmp/ccwLkVQ4.i
...
 /mnt/scratch/install-r155621/libexec/gcc/sparc64-unknown-linux-gnu/4.5.0/cc1
/tmp/ccwLkVQ4.i -quiet -dumpbase ArrayStore2main.c -mcpu=v8 -g1 -version
-fdollars-in-identifiers -o /tmp/ccCkBmCp.s
...
 as -V -Qy -s -32 -relax -o /tmp/cc8Sx4xt.o /tmp/ccCkBmCp.s
...
> LD_LIBRARY_PATH=/mnt/scratch/install-r155621/lib: ./a.out
index
rhs
java.lang.ArrayIndexOutOfBoundsException

> LD_LIBRARY_PATH=/mnt/scratch/install-r155622/lib: /mnt/scratch/install-r155622/bin/gcj -v -findirect-dispatch --main=ArrayStore2 ArrayStore2.jar
...
 /mnt/scratch/install-r155622/libexec/gcc/sparc64-unknown-linux-gnu/4.5.0/jc1
ArrayStore2.jar -fuse-divide-subroutine -fuse-boehm-gc -fnon-call-exceptions
-fPIC -fkeep-inline-functions -quiet -dumpbase ArrayStore2.jar -mcpu=v8
-auxbase ArrayStore2 -g1 -version -findirect-dispatch
-fbootclasspath=./:/mnt/scratch/install-r155622/share/java/libgcj-4.5.0.jar -o
/tmp/cc5XY9sD.s
...
 as -V -Qy -s -K PIC -32 -relax -o /tmp/cc626Pob.o /tmp/cc5XY9sD.s
...

/mnt/scratch/install-r155622/libexec/gcc/sparc64-unknown-linux-gnu/4.5.0/jvgenmain
-findirect-dispatch ArrayStore2main /tmp/ccLsDapM.i
...
 /mnt/scratch/install-r155622/libexec/gcc/sparc64-unknown-linux-gnu/4.5.0/cc1
/tmp/ccLsDapM.i -quiet -dumpbase ArrayStore2main.c -mcpu=v8 -g1 -version
-fdollars-in-identifiers -o /tmp/cc5XY9sD.s
...
 as -V -Qy -s -K PIC -32 -relax -o /tmp/ccw9Ke7n.o /tmp/cc5XY9sD.s
...
> LD_LIBRARY_PATH=/mnt/scratch/install-r155622/lib:. ./a.out
Segmentation fault

The main difference is that in the working compiler, the java classes are
assembled with -K PIC but the generated main() is not, while in the broken
compiler both the java classes and the generated main() are assembled with -K
PIC.  If I force -K PIC with the working compiler it too fails:

> LD_LIBRARY_PATH=/mnt/scratch/install-r155621/lib: /mnt/scratch/install-r155621/bin/gcj -findirect-dispatch --main=ArrayStore2 -Wa,-K,PIC ArrayStore2.jar
> LD_LIBRARY_PATH=/mnt/scratch/install-r155621/lib: ./a.out
Segmentation fault

I note that gcc/java/jvspec.c has %<findirect-dispatch, and that PR42442 is
about correcting the handling of %<match=native.  Clearly something here
doesn't mix well.


-- 
           Summary: [4.5/4.6 regression] massive java failures due to -
                    findirect-dispatch breakage on sparc64-linux
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mikpe at it dot uu dot se
 GCC build triplet: sparc64-unknown-linux-gnu
  GCC host triplet: sparc64-unknown-linux-gnu
GCC target triplet: sparc64-unknown-linux-gnu


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


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

* [Bug java/44095] [4.5/4.6 regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux
  2010-05-12 11:00 [Bug java/44095] New: [4.5/4.6 regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux mikpe at it dot uu dot se
@ 2010-05-12 11:35 ` rguenth at gcc dot gnu dot org
  2010-05-19 12:59 ` [Bug java/44095] [4.5/4.6 Regression] " rguenth at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-12 11:35 UTC (permalink / raw)
  To: java-prs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.5.1


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


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

* [Bug java/44095] [4.5/4.6 Regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux
  2010-05-12 11:00 [Bug java/44095] New: [4.5/4.6 regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux mikpe at it dot uu dot se
  2010-05-12 11:35 ` [Bug java/44095] " rguenth at gcc dot gnu dot org
@ 2010-05-19 12:59 ` rguenth at gcc dot gnu dot org
  2010-07-31  9:33 ` rguenth at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-19 12:59 UTC (permalink / raw)
  To: java-prs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
            Summary|[4.5/4.6 regression] massive|[4.5/4.6 Regression] massive
                   |java failures due to -      |java failures due to -
                   |findirect-dispatch breakage |findirect-dispatch breakage
                   |on sparc64-linux            |on sparc64-linux


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


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

* [Bug java/44095] [4.5/4.6 Regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux
  2010-05-12 11:00 [Bug java/44095] New: [4.5/4.6 regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux mikpe at it dot uu dot se
  2010-05-12 11:35 ` [Bug java/44095] " rguenth at gcc dot gnu dot org
  2010-05-19 12:59 ` [Bug java/44095] [4.5/4.6 Regression] " rguenth at gcc dot gnu dot org
@ 2010-07-31  9:33 ` rguenth at gcc dot gnu dot org
  2010-09-20 21:40 ` ebotcazou at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-07-31  9:33 UTC (permalink / raw)
  To: java-prs



------- Comment #1 from rguenth at gcc dot gnu dot org  2010-07-31 09:29 -------
GCC 4.5.1 is being released, adjusting target milestone.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.5.1                       |4.5.2


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


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

* [Bug java/44095] [4.5/4.6 Regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux
  2010-05-12 11:00 [Bug java/44095] New: [4.5/4.6 regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux mikpe at it dot uu dot se
                   ` (2 preceding siblings ...)
  2010-07-31  9:33 ` rguenth at gcc dot gnu dot org
@ 2010-09-20 21:40 ` ebotcazou at gcc dot gnu dot org
  2010-09-21 21:45 ` ebotcazou at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2010-09-20 21:40 UTC (permalink / raw)
  To: java-prs



------- Comment #2 from ebotcazou at gcc dot gnu dot org  2010-09-20 21:40 -------
Investigating.


-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |ebotcazou at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-09-20 21:40:00
               date|                            |


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


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

* [Bug java/44095] [4.5/4.6 Regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux
  2010-05-12 11:00 [Bug java/44095] New: [4.5/4.6 regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux mikpe at it dot uu dot se
                   ` (3 preceding siblings ...)
  2010-09-20 21:40 ` ebotcazou at gcc dot gnu dot org
@ 2010-09-21 21:45 ` ebotcazou at gcc dot gnu dot org
  2010-09-22  6:06 ` ebotcazou at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2010-09-21 21:45 UTC (permalink / raw)
  To: java-prs



------- Comment #3 from ebotcazou at gcc dot gnu dot org  2010-09-21 21:45 -------
> Java is severely broken on sparc64-linux with gcc 4.5/4.6, which is a major
> regression from 4.4:
> 
> http://gcc.gnu.org/ml/gcc-testresults/2010-05/msg00853.html (4.6 broken)
> http://gcc.gnu.org/ml/gcc-testresults/2010-05/msg00681.html (4.5 broken)
> http://gcc.gnu.org/ml/gcc-testresults/2010-05/msg00472.html (4.4 works)
> 
> The detailed test suite logs show that _every_ -findirect-dispatch test case
> SEGFAULTs shortly after startup.
> 
> I've bisected trunk and identified r155622 as the cause:
> 
> Author: jakub
> Date: Mon Jan  4 16:02:41 2010
> New Revision: 155622
> 
> URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155622
> Log:
>         PR driver/42442
>         * gcc.c (SWITCH_IGNORE_PERMANENTLY): Define.
>         (do_self_spec): For switches with SWITCH_IGNORE set set also
>         SWITCH_IGNORE_PERMANENTLY.
>         (check_live_switch): Check SWITCH_IGNORE_PERMANENTLY instead
>         of SWITCH_IGNORE.
>
> [...]
>
> The main difference is that in the working compiler, the java classes are
> assembled with -K PIC but the generated main() is not, while in the broken
> compiler both the java classes and the generated main() are assembled with -K
> PIC.

Thanks for the detailed analysis.

> I note that gcc/java/jvspec.c has %<findirect-dispatch, and that PR42442 is
> about correcting the handling of %<match=native.  Clearly something here
> doesn't mix well.

My interpretation is that the %<findirect-dispatch for cc1 used to cancel the
effect of -findirect-dispatch for subsequent programs invoked by the driver, in
particular 'as' in this case.  Jakub's change disables this cancellation so
-findirect-dispatch is passed to 'as' and thus the kludge I put in ASM_SPEC for
Linux triggers, which breaks because cc1 hasn't compiled the file in PIC mode.


-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2010-09-20 21:40:00         |2010-09-21 21:45:21
               date|                            |


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


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

* [Bug java/44095] [4.5/4.6 Regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux
  2010-05-12 11:00 [Bug java/44095] New: [4.5/4.6 regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux mikpe at it dot uu dot se
                   ` (4 preceding siblings ...)
  2010-09-21 21:45 ` ebotcazou at gcc dot gnu dot org
@ 2010-09-22  6:06 ` ebotcazou at gcc dot gnu dot org
  2010-09-22  8:07 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2010-09-22  6:06 UTC (permalink / raw)
  To: java-prs



------- Comment #4 from ebotcazou at gcc dot gnu dot org  2010-09-22 06:06 -------
Jakub, what do you think?  gcc.c reads:

 %<S    remove all occurrences of -S from the command line.
        Note - this command is position dependent.  % commands in the
        spec string before this one will see -S, % commands in the
        spec string after this one will not.

and the spec is gcc/java/jvspec.c:jvgenmain_spec.  I think that the above means
that 'as' shoudn't see -findirect-dispatch but your change breaks that.


-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu dot org


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


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

* [Bug java/44095] [4.5/4.6 Regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux
  2010-05-12 11:00 [Bug java/44095] New: [4.5/4.6 regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux mikpe at it dot uu dot se
                   ` (5 preceding siblings ...)
  2010-09-22  6:06 ` ebotcazou at gcc dot gnu dot org
@ 2010-09-22  8:07 ` jakub at gcc dot gnu dot org
  2010-09-22 21:15 ` ebotcazou at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-09-22  8:07 UTC (permalink / raw)
  To: java-prs



------- Comment #5 from jakub at gcc dot gnu dot org  2010-09-22 08:07 -------
That semantics can't cope well with -fcompare-debug though, where cc1 etc. is
invoked multiple times.  If you remove some options forever, they wouldn't
appear on the next cc1 etc. invocation line and thus that would behave
differently.  I wonder if e.g. not using %(invoke_as) but instead duplicating
its text in java/jvspec.c with additional %<findirect-dispatch right after as
and before %(asm_options) wouldn't do the trick.
Or we need a different % letter that would have the previous behavior, though
am not sure if it could ever work with gcj -fcompare-debug -fmain=myclass
myclass.java


-- 


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


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

* [Bug java/44095] [4.5/4.6 Regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux
  2010-05-12 11:00 [Bug java/44095] New: [4.5/4.6 regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux mikpe at it dot uu dot se
                   ` (6 preceding siblings ...)
  2010-09-22  8:07 ` jakub at gcc dot gnu dot org
@ 2010-09-22 21:15 ` ebotcazou at gcc dot gnu dot org
  2010-09-22 21:17 ` ebotcazou at gcc dot gnu dot org
  2010-09-22 21:19 ` ebotcazou at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2010-09-22 21:15 UTC (permalink / raw)
  To: java-prs



------- Comment #6 from ebotcazou at gcc dot gnu dot org  2010-09-22 21:15 -------
Subject: Bug 44095

Author: ebotcazou
Date: Wed Sep 22 21:14:50 2010
New Revision: 164534

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164534
Log:
        PR java/44095
        * config/sparc/linux.h (ASM_SPEC): Pass -K PIC if -findirect-dispatch
        is specified and the suffix of the file isn't ".c".
        * config/sparc/linux64.h (ASM_SPEC): Likewise.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/sparc/linux.h
    trunk/gcc/config/sparc/linux64.h


-- 


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


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

* [Bug java/44095] [4.5/4.6 Regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux
  2010-05-12 11:00 [Bug java/44095] New: [4.5/4.6 regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux mikpe at it dot uu dot se
                   ` (7 preceding siblings ...)
  2010-09-22 21:15 ` ebotcazou at gcc dot gnu dot org
@ 2010-09-22 21:17 ` ebotcazou at gcc dot gnu dot org
  2010-09-22 21:19 ` ebotcazou at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2010-09-22 21:17 UTC (permalink / raw)
  To: java-prs



------- Comment #7 from ebotcazou at gcc dot gnu dot org  2010-09-22 21:16 -------
Subject: Bug 44095

Author: ebotcazou
Date: Wed Sep 22 21:15:37 2010
New Revision: 164535

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164535
Log:
        PR java/44095
        * config/sparc/linux.h (ASM_SPEC): Pass -K PIC if -findirect-dispatch
        is specified and the suffix of the file isn't ".c".
        * config/sparc/linux64.h (ASM_SPEC): Likewise.

Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/config/sparc/linux.h
    branches/gcc-4_5-branch/gcc/config/sparc/linux64.h


-- 


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


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

* [Bug java/44095] [4.5/4.6 Regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux
  2010-05-12 11:00 [Bug java/44095] New: [4.5/4.6 regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux mikpe at it dot uu dot se
                   ` (8 preceding siblings ...)
  2010-09-22 21:17 ` ebotcazou at gcc dot gnu dot org
@ 2010-09-22 21:19 ` ebotcazou at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2010-09-22 21:19 UTC (permalink / raw)
  To: java-prs



------- Comment #8 from ebotcazou at gcc dot gnu dot org  2010-09-22 21:19 -------
Further kludged.


-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2010-
                   |                            |09/msg01800.html
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2010-09-22 21:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-12 11:00 [Bug java/44095] New: [4.5/4.6 regression] massive java failures due to -findirect-dispatch breakage on sparc64-linux mikpe at it dot uu dot se
2010-05-12 11:35 ` [Bug java/44095] " rguenth at gcc dot gnu dot org
2010-05-19 12:59 ` [Bug java/44095] [4.5/4.6 Regression] " rguenth at gcc dot gnu dot org
2010-07-31  9:33 ` rguenth at gcc dot gnu dot org
2010-09-20 21:40 ` ebotcazou at gcc dot gnu dot org
2010-09-21 21:45 ` ebotcazou at gcc dot gnu dot org
2010-09-22  6:06 ` ebotcazou at gcc dot gnu dot org
2010-09-22  8:07 ` jakub at gcc dot gnu dot org
2010-09-22 21:15 ` ebotcazou at gcc dot gnu dot org
2010-09-22 21:17 ` ebotcazou at gcc dot gnu dot org
2010-09-22 21:19 ` ebotcazou 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).