Bug 10908

Summary: Addresses of protected symbols don't work right on ia32
Product: gcc Reporter: H.J. Lu <hjl.tools>
Component: targetAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED INVALID    
Severity: normal CC: gcc-bugs
Priority: P2 Keywords: wrong-code
Version: 3.4.0   
Target Milestone: ---   
Host: i686-pc-linux-gnu Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2003-05-31 19:11:47
Attachments: A testcase

Description H.J. Lu 2003-05-21 16:05:08 UTC
# make
gcc -O -DGCC_BUG -c main.c
gcc -O -DGCC_BUG -fPIC -c shared.c
gcc -shared -o libfoo.so  shared.o
gcc -o foo  main.o libfoo.so -Wl,-rpath,.
for f in foo; do echo "Running: $f"; ./$f; \
  if [ $? != 0 ]; then echo Failed; fi; done
Running: foo
Data address: 0x8049924 != Data address from DSO: 0x400187e4
Function address: 0x80484c0 !=  Function address from DSO: 0x4001775f
Data: 100 != Data from DSO: 10
Failed

The data address will always differ on ia32. There is a proposal for
the ia32 psABI to address it. But without -DGCC_BUG,

Function address: 0x80484c0 !=  Function address from DSO: 0x4001775f

isn't there.
Comment 1 H.J. Lu 2003-05-21 16:05:56 UTC
Created attachment 4043 [details]
A testcase
Comment 2 Dara Hazeghi 2003-05-31 19:11:47 UTC
Hello,

I can confirm that this behavior occurs on gcc 3.2, 3.3 branch and mainline (20030525). HJ, is this 
a C bug, or a target (ia32) bug here? Thanks,

Dara
Comment 3 H.J. Lu 2003-05-31 20:56:21 UTC
This bug shows up on ia32. But it may happen to any
targets on which gcc optimizes access to protected symbols.
Comment 4 Dara Hazeghi 2003-08-23 00:07:07 UTC
Not a regression.
Comment 5 Andrew Pinski 2003-12-17 05:39:21 UTC
GCC is not optimizing the address at all so it cannot be a GCC problem (yes I looked at the asm to 
see what was happening and there was no way that GCC is getting this wrong).
Comment 6 Andrew Pinski 2003-12-17 05:41:02 UTC
Reopening it for now.
Comment 7 Andrew Pinski 2003-12-17 05:41:47 UTC
Should have marked it as invalid as main is the same for both and GCC does not take into account 
that.
Comment 8 Andrew Pinski 2003-12-17 06:02:55 UTC
  /* A variable is local if the user tells us so.  */
  else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT)
    local_p = true;

Yes this is still invalid as GCC is not were the problem is (the optimization is right).
Comment 9 GCC Commits 2004-11-06 23:01:16 UTC
Subject: Bug 10908

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	java-gui-branch
Changes by:	mark@gcc.gnu.org	2004-11-06 23:01:13

Modified files:
	libjava        : ChangeLog 
	libjava/gnu/java/beans: IntrospectionIncubator.java 

Log message:
	2004-11-06  Robert Schuster  <theBohemian@gmx.net>
	
	Fixes bug #10908
	* gnu/java/beans/IntrospectionIncubator.java:

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&only_with_tag=java-gui-branch&r1=1.2660.2.497&r2=1.2660.2.498
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/gnu/java/beans/IntrospectionIncubator.java.diff?cvsroot=gcc&only_with_tag=java-gui-branch&r1=1.3&r2=1.3.10.1

Comment 10 GCC Commits 2004-11-07 12:38:15 UTC
Subject: Bug 10908

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mark@gcc.gnu.org	2004-11-07 12:38:04

Modified files:
	libjava        : ChangeLog 
	libjava/gnu/java/beans: IntrospectionIncubator.java 

Log message:
	2004-11-07  Robert Schuster  <theBohemian@gmx.net>
	
	Fixes bug #10908
	* gnu/java/beans/IntrospectionIncubator.java:
	(addMethod): static methods are discarded now, too.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&r1=1.3194&r2=1.3195
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/gnu/java/beans/IntrospectionIncubator.java.diff?cvsroot=gcc&r1=1.4&r2=1.5

Comment 11 Andrew Pinski 2005-01-19 00:56:20 UTC
*** Bug 19520 has been marked as a duplicate of this bug. ***