public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/16343] New: invalid code when using -meabi -msdata=eabi
@ 2004-07-03  6:58 wintermute2k4 at ntlworld dot com
  2004-07-03  7:07 ` [Bug c/16343] " wintermute2k4 at ntlworld dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: wintermute2k4 at ntlworld dot com @ 2004-07-03  6:58 UTC (permalink / raw)
  To: gcc-bugs

compiler generates code for a function pointer as a small data area reference.

linker reports

the target (testCB) of a R_PPC_EMB_SDA21 relocation is in the wrong output section (.text)
final link failed: Bad value

Configured with:
../../gcc-3.4.0//configure --enable-languages=c,c++ --with-cpu=750 --with-gc
c --with-gnu-ld --with-gnu-as --with-stabs --disable-nls --disable-shared --
disable-threads --disable-multilib --disable-win32-registry --target=powerpc
-elf --
with-newlib --prefix=c:/devkitPPC_r7a -v
Thread model: single
gcc version 3.4.0

embedded system using newlib 1.12.0

-- 
           Summary: invalid code when using -meabi -msdata=eabi
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: wintermute2k4 at ntlworld dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-mingw32
  GCC host triplet: i686-pc-mingw32
GCC target triplet: powerpc-*-elf


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


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

* [Bug c/16343] invalid code when using -meabi -msdata=eabi
  2004-07-03  6:58 [Bug c/16343] New: invalid code when using -meabi -msdata=eabi wintermute2k4 at ntlworld dot com
@ 2004-07-03  7:07 ` wintermute2k4 at ntlworld dot com
  2004-07-03  7:13 ` wintermute2k4 at ntlworld dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: wintermute2k4 at ntlworld dot com @ 2004-07-03  7:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From wintermute2k4 at ntlworld dot com  2004-07-03 07:07 -------
Created an attachment (id=6679)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6679&action=view)
testcase showing the problem

compile with -mseabi -msdata=eabi switches

-- 


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


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

* [Bug c/16343] invalid code when using -meabi -msdata=eabi
  2004-07-03  6:58 [Bug c/16343] New: invalid code when using -meabi -msdata=eabi wintermute2k4 at ntlworld dot com
  2004-07-03  7:07 ` [Bug c/16343] " wintermute2k4 at ntlworld dot com
@ 2004-07-03  7:13 ` wintermute2k4 at ntlworld dot com
  2004-07-06 15:15 ` [Bug target/16343] " dje at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: wintermute2k4 at ntlworld dot com @ 2004-07-03  7:13 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wintermute2k4 at ntlworld
                   |                            |dot com


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


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

* [Bug target/16343] invalid code when using -meabi -msdata=eabi
  2004-07-03  6:58 [Bug c/16343] New: invalid code when using -meabi -msdata=eabi wintermute2k4 at ntlworld dot com
  2004-07-03  7:07 ` [Bug c/16343] " wintermute2k4 at ntlworld dot com
  2004-07-03  7:13 ` wintermute2k4 at ntlworld dot com
@ 2004-07-06 15:15 ` dje at gcc dot gnu dot org
  2004-08-25 12:40 ` amodra at bigpond dot net dot au
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dje at gcc dot gnu dot org @ 2004-07-06 15:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dje at gcc dot gnu dot org  2004-07-06 15:15 -------
target bug, add cc

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dje at watson dot ibm dot
                   |                            |com
          Component|c                           |target


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


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

* [Bug target/16343] invalid code when using -meabi -msdata=eabi
  2004-07-03  6:58 [Bug c/16343] New: invalid code when using -meabi -msdata=eabi wintermute2k4 at ntlworld dot com
                   ` (2 preceding siblings ...)
  2004-07-06 15:15 ` [Bug target/16343] " dje at gcc dot gnu dot org
@ 2004-08-25 12:40 ` amodra at bigpond dot net dot au
  2004-11-12 19:21 ` a_fisch at gmx dot de
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: amodra at bigpond dot net dot au @ 2004-08-25 12:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From amodra at bigpond dot net dot au  2004-08-25 12:40 -------
Fails on current 3.4 branch and mainline.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
      Known to fail|                            |3.4.2 3.5.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-08-25 12:40:40
               date|                            |


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


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

* [Bug target/16343] invalid code when using -meabi -msdata=eabi
  2004-07-03  6:58 [Bug c/16343] New: invalid code when using -meabi -msdata=eabi wintermute2k4 at ntlworld dot com
                   ` (3 preceding siblings ...)
  2004-08-25 12:40 ` amodra at bigpond dot net dot au
@ 2004-11-12 19:21 ` a_fisch at gmx dot de
  2004-11-27  8:58 ` amodra at bigpond dot net dot au
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: a_fisch at gmx dot de @ 2004-11-12 19:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From a_fisch at gmx dot de  2004-11-12 19:20 -------
The Bug is in gcc/config/rs6000/rs6000.c in function 
rs6000_elf_in_small_data_p() 
 
With gcc version 3.4.x? (2003-05-02) the macro SYMBOL_REF_SMALL_P () was 
introduced, which checks for a flag, which is not properly set, if the 
referenced symbol is a function.  
 
The flag is used in small_data_operand () but has to be set in  
rs6000_elf_in_small_data_p (). 
 
I compared the implementation of ??_in_small_data_p() for different cpu's 
(alpha, mips) and changed rs6000_elf_in_small_data_p () as follows: 
 
static bool 
rs6000_elf_in_small_data_p (tree decl) 
{ 
  if (rs6000_sdata == SDATA_NONE) 
    return false; 
 
/* --------- Begin of code to insert ---------- */ 
  /* We want to merge strings, so we never consider them small data. */ 
  if (TREE_CODE (decl) == STRING_CST) 
      return false; 
   
  /* Functions are never in the small data area. */ 
  if (TREE_CODE (decl) == FUNCTION_DECL) 
      return false; 
/* --------- End of code to insert ---------- */ 
   
  if (TREE_CODE (decl) == VAR_DECL && DECL_SECTION_NAME (decl)) 
    { 
      const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (decl)); 
      if (strcmp (section, ".sdata") == 0 
	  || strcmp (section, ".sdata2") == 0 
	  || strcmp (section, ".sbss") == 0 
	  || strcmp (section, ".sbss2") == 0 
	  || strcmp (section, ".PPC.EMB.sdata0") == 0 
	  || strcmp (section, ".PPC.EMB.sbss0") == 0) 
	return true; 
    } 
  else 
    { 
      HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (decl)); 
 
      if (size > 0 
	  && (unsigned HOST_WIDE_INT) size <= g_switch_value 
	  /* If it's not public, and we're not going to reference it there, 
	     there's no need to put it in the small data section.  */ 
	  && (rs6000_sdata != SDATA_DATA || TREE_PUBLIC (decl))) 
	return true; 
    } 
 
  return false; 
} 
 
I tested the changed code and the result is promising. As far as I know this 
error must have effected all powerpc-targets which use ELF and have small data 
areas (powerpc-elf, powerpc-eabi, ...) 
 
Because I'm not familiar with the process of generating patches and sending 
the result back to the mainline, I would like to ask one of you, watching this 
error to integerate it. 
   
 
 
 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |a_fisch at gmx dot de


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


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

* [Bug target/16343] invalid code when using -meabi -msdata=eabi
  2004-07-03  6:58 [Bug c/16343] New: invalid code when using -meabi -msdata=eabi wintermute2k4 at ntlworld dot com
                   ` (4 preceding siblings ...)
  2004-11-12 19:21 ` a_fisch at gmx dot de
@ 2004-11-27  8:58 ` amodra at bigpond dot net dot au
  2004-11-27 11:47 ` amodra at bigpond dot net dot au
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: amodra at bigpond dot net dot au @ 2004-11-27  8:58 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |amodra at bigpond dot net
                   |dot org                     |dot au
             Status|NEW                         |ASSIGNED


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


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

* [Bug target/16343] invalid code when using -meabi -msdata=eabi
  2004-07-03  6:58 [Bug c/16343] New: invalid code when using -meabi -msdata=eabi wintermute2k4 at ntlworld dot com
                   ` (5 preceding siblings ...)
  2004-11-27  8:58 ` amodra at bigpond dot net dot au
@ 2004-11-27 11:47 ` amodra at bigpond dot net dot au
  2004-11-27 22:51 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: amodra at bigpond dot net dot au @ 2004-11-27 11:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From amodra at bigpond dot net dot au  2004-11-27 11:47 -------
http://gcc.gnu.org/ml/gcc-patches/2004-11/msg02367.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
      Known to fail|3.4.2 4.0.0                 |3.4.2 3.4.3 4.0.0
   Target Milestone|---                         |3.4.4


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


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

* [Bug target/16343] invalid code when using -meabi -msdata=eabi
  2004-07-03  6:58 [Bug c/16343] New: invalid code when using -meabi -msdata=eabi wintermute2k4 at ntlworld dot com
                   ` (6 preceding siblings ...)
  2004-11-27 11:47 ` amodra at bigpond dot net dot au
@ 2004-11-27 22:51 ` cvs-commit at gcc dot gnu dot org
  2004-11-27 22:57 ` cvs-commit at gcc dot gnu dot org
  2004-11-27 22:58 ` amodra at bigpond dot net dot au
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-11-27 22:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-11-27 22:51 -------
Subject: Bug 16343

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	amodra@gcc.gnu.org	2004-11-27 22:51:45

Modified files:
	gcc            : ChangeLog 
	gcc/config/rs6000: rs6000.c 

Log message:
	PR target/16343
	* config/rs6000/rs6000.c (rs6000_elf_in_small_data_p): Disallow
	functions, strings and thread-local vars.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.6592&r2=2.6593
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.c.diff?cvsroot=gcc&r1=1.755&r2=1.756



-- 


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


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

* [Bug target/16343] invalid code when using -meabi -msdata=eabi
  2004-07-03  6:58 [Bug c/16343] New: invalid code when using -meabi -msdata=eabi wintermute2k4 at ntlworld dot com
                   ` (7 preceding siblings ...)
  2004-11-27 22:51 ` cvs-commit at gcc dot gnu dot org
@ 2004-11-27 22:57 ` cvs-commit at gcc dot gnu dot org
  2004-11-27 22:58 ` amodra at bigpond dot net dot au
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-11-27 22:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-11-27 22:57 -------
Subject: Bug 16343

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	amodra@gcc.gnu.org	2004-11-27 22:57:12

Modified files:
	gcc            : ChangeLog 
	gcc/config/rs6000: rs6000.c 

Log message:
	PR target/16343
	* config/rs6000/rs6000.c (rs6000_elf_in_small_data_p): Disallow
	functions, strings and thread-local vars.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.707&r2=2.2326.2.708
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.576.2.35&r2=1.576.2.36



-- 


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


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

* [Bug target/16343] invalid code when using -meabi -msdata=eabi
  2004-07-03  6:58 [Bug c/16343] New: invalid code when using -meabi -msdata=eabi wintermute2k4 at ntlworld dot com
                   ` (8 preceding siblings ...)
  2004-11-27 22:57 ` cvs-commit at gcc dot gnu dot org
@ 2004-11-27 22:58 ` amodra at bigpond dot net dot au
  9 siblings, 0 replies; 11+ messages in thread
From: amodra at bigpond dot net dot au @ 2004-11-27 22:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From amodra at bigpond dot net dot au  2004-11-27 22:58 -------
Fixed

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


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


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

end of thread, other threads:[~2004-11-27 22:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-03  6:58 [Bug c/16343] New: invalid code when using -meabi -msdata=eabi wintermute2k4 at ntlworld dot com
2004-07-03  7:07 ` [Bug c/16343] " wintermute2k4 at ntlworld dot com
2004-07-03  7:13 ` wintermute2k4 at ntlworld dot com
2004-07-06 15:15 ` [Bug target/16343] " dje at gcc dot gnu dot org
2004-08-25 12:40 ` amodra at bigpond dot net dot au
2004-11-12 19:21 ` a_fisch at gmx dot de
2004-11-27  8:58 ` amodra at bigpond dot net dot au
2004-11-27 11:47 ` amodra at bigpond dot net dot au
2004-11-27 22:51 ` cvs-commit at gcc dot gnu dot org
2004-11-27 22:57 ` cvs-commit at gcc dot gnu dot org
2004-11-27 22:58 ` amodra at bigpond dot net dot au

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