public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11190] New: ICE in output_operand (wrong address) with static and -fPIC
@ 2003-06-13 23:48 eager@mvista.com
  2003-06-14  0:05 ` [Bug c++/11190] " bangerth@dealii.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: eager@mvista.com @ 2003-06-13 23:48 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: ICE in output_operand (wrong address) with static and -
                    fPIC
           Product: gcc
           Version: 3.2.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: eager@mvista.com
                CC: gcc-bugs@gcc.gnu.org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-hardhat-linux

I compile the attached test case with G++ 3.2.2 specifying -fPIC:

  g++ -fPIC x.cpp -o x

the following error is generated:

  x.cpp: In function `int ListNextX()':
  x.cpp:19: output_operand: Wrong address expression or operand constraint

The error appears to occur when code for the structure assignment
on line 16 is being generated.  The messages is actually generated by 
print_operand_address() in i386.c.  The rtx node that it fails on is 

(plus:SI (mem:SI (plus:SI (reg/f:SI 6 ebp)
            (const_int -1344 [0xfffffac0])) [0 S4 A8])
    (const:SI (unspec:SI[ 
                (symbol_ref/v:SI ("AppList"))
            ]  7)))

If I remove the "static" storage attribute from AppList, the error 
disappears.  The corresponding rtx node is a bit different:

(mem/u:SI (plus:SI (reg:SI 3 ebx)
        (const:SI (unspec:SI[ 
                    (symbol_ref:SI ("AppList"))
                ]  6))) [0 S4 A8])

If I read the code correctly, by the time output_operand is called,
the expectation is that the rtx can be assembled with one instruction.
The failing node can't be output as a single x86 instruction, it looks
like it should be converted into two (or more) instructions.


Test case (x.cpp):
typedef struct {
   int                  Id;
   char Errors[128][10];
} ListElem_T;


//static
ListElem_T   AppList[100];

int
ListNextX()
{
   unsigned int i;
   ListElem_T x;

       x = AppList[i]; /* Structure Assignment */

   return -1;
}


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

end of thread, other threads:[~2003-07-27 18:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-13 23:48 [Bug c++/11190] New: ICE in output_operand (wrong address) with static and -fPIC eager@mvista.com
2003-06-14  0:05 ` [Bug c++/11190] " bangerth@dealii.org
2003-06-14  0:10 ` pinskia@physics.uc.edu
2003-06-14  0:21 ` eager@mvista.com
2003-07-27 18:48 ` pinskia at physics dot uc dot edu

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