Bug 4587 - [AIX] g++ -maix64 generates illeagal assembler code
Summary: [AIX] g++ -maix64 generates illeagal assembler code
Status: RESOLVED DUPLICATE of bug 378
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.0.1
: P2 critical
Target Milestone: ---
Assignee: David Edelsohn
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2001-10-16 23:56 UTC by hashikaw
Modified: 2003-06-16 19:12 UTC (History)
3 users (show)

See Also:
Host: powerpc-ibm-aix5.1.0.0
Target: powerpc-ibm-aix5.1.0.0
Build: powerpc-ibm-aix5.1.0.0
Known to work:
Known to fail:
Last reconfirmed:


Attachments
bigfile2.ii.gz (83.56 KB, application/x-gzip )
2003-05-21 15:17 UTC, hashikaw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hashikaw 2001-10-16 23:56:00 UTC
how to compile:
% g++ -maix64 -g -o bigfile2 bigfile2.cc -save-temps -v

error message:
Reading specs from /usr/local/lib/gcc-lib/rs6000-ibm-aix5.1.0.0/3.0.1/specs
Configured with: ../configure rs6000-ibm-aix5.1.0.0
Thread model: single
gcc version 3.0.1
GNU CPP version 3.0.1 (cpplib)
ignoring nonexistent directory "/usr/local/rs6000-ibm-aix5.1.0.0/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++-v3
 /usr/local/include/g++-v3/rs6000-ibm-aix5.1.0.0
 /usr/local/include/g++-v3/backward
 /usr/local/include
 /usr/local/lib/gcc-lib/rs6000-ibm-aix5.1.0.0/3.0.1/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/rs6000-ibm-aix5.1.0.0/3.0.1/cc1plus -fpreprocessed bigfile2.ii -quiet -dumpbase bigfile2.cc -maix64 -g -version -o bigfile2.s
GNU CPP version 3.0.1 (cpplib)
GNU C++ version 3.0.1 (rs6000-ibm-aix5.1.0.0)
        compiled by GNU C version 2.9-aix43-010414.
 as -u -a64 -mppc64 -o bigfile2.o bigfile2.s
Assembler:
bigfile2.s: line 96894: The displacement must be greater than or equal to
        -32768 and less than or equal to 32767.
bigfile2.s: line 96903: The displacement must be greater than or equal to
        -32768 and less than or equal to 32767.
bigfile2.s: line 96912: The displacement must be greater than or equal to
        -32768 and less than or equal to 32767.
bigfile2.s: line 96921: The displacement must be greater than or equal to
        -32768 and less than or equal to 32767.
....

This assembler is AIX's assembler.
IBM AIX development team says, this error is not assember's problem:

 Problem is with g++ compiler. You are hitting the
 hardware limitation. To make it clear consider an opcode
 .
 ld  r4,X(r3);
 .
 where X will be at most 16 bit.
 So irrespective of 64bit or 32 bit object file
 we can traverse  an offset value of 16 bit.
 While creating the assembly listing g++ crossed
 the limitation. So assembler throws series of error
 messages.
 .
 Customer can use  IBM compiler, which takes care
 of this problem and we are not supporting the g++
 compiler.
 .

Release:
gcc version 3.0.1

Environment:
AIX 5.1 (Maintenance Level 01)
(rs6000-ibm-aix5.1.0.0)
Comment 1 hashikaw 2001-10-25 02:56:55 UTC
From: hashikaw@awa.tohoku.ac.jp (Kouichi Hashikawa)
To: gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org
Cc: hashikaw@awa.tohoku.ac.jp
Subject: Re: c++/4587: g++ -maix64 generates illeagal assembler code
Date: Thu, 25 Oct 2001 02:56:55 +0900

 I want to modify my problem report.
 
 How-To-Repeat:
 	% setenv OBJECT_MODE 64
 	% g++ -maix64 -g -o bigfile2 bigfile2.cc -save-temps -v
 
 Fix:
 	gcc-3.0.1 generated following assembler code.
 	this code passed to AIX's /usr/ccs/bin/as.
 
  96890		bl ._ZNSolsEPFRSoS_E
  96891		nop
  96892		.line	4096
  96893		ld 3,LC..1(2)
  96894		ld 4,LC..8191(2)
  96895		bl ._ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
  96896		nop
  96897		mr 0,3
  96898		ld 4,LC..3(2)
  96899		bl ._ZNSolsEPFRSoS_E
  96900		nop
  96901		.line	4097
  96902		ld 3,LC..1(2)
  96903		ld 4,LC..8193(2)
  96904		bl ._ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
  96905		nop
  96906		mr 0,3
  96907		ld 4,LC..3(2)
  96908		bl ._ZNSolsEPFRSoS_E
  96909		nop
  96910		.line	4098
  96911		ld 3,LC..1(2)
  96912		ld 4,LC..8195(2)
  96913		bl ._ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
  96914		nop
 
 	IBM AIX development team says:
 
 	Problem is with g++ compiler. You are hitting the
 	hardware limitation. To make it clear consider an opcode
 	.
 	ld r4,X(r3);
 	.
 	where X will be at most 16 bit.
 	So irrespective of 64bit or 32 bit object file
 	we can traverse an offset value of 16 bit.
 	While creating the assembly listing g++ crossed
 	the limitation. So assembler throws series of error
 	messages.
 
 -- 
 $B66@n8w0l(B ($B$O$7$+$o$3$&$$$A(B) hashikaw@awa.tohoku.ac.jp
Comment 2 Craig Rodrigues 2001-11-01 18:12:39 UTC
State-Changed-From-To: open->suspended
State-Changed-Why: According to David Edelsohn  <edelsohn@gnu.org>,
    "        The issue is not -maix64, it is compiling excessively large files
    with large functions.  In both cases, GCC is trying to generate a branch
    with a displacement larger than the architecture allows."
    
    The workaround is not to compile excessively large files.
Comment 3 David Edelsohn 2001-12-28 08:43:54 UTC
Responsible-Changed-From-To: unassigned->dje
Responsible-Changed-Why: AIX problem
Comment 4 Dara Hazeghi 2003-05-22 00:46:33 UTC
Hello,

does anybody know if this problem is still an issue? David says this is a problem with large files. If 
so, does that make this effectively a duplicate of PR 387? Thanks,

Dara
Comment 5 Nathanael C. Nerode 2003-06-13 12:44:06 UTC
see Dara's question.
Comment 6 Dara Hazeghi 2003-06-16 18:41:50 UTC
David,

would you mind commenting on the status of this bug? Is this in fact a duplicate of bug 387? 
Thanks,

Dara
Comment 7 David Edelsohn 2003-06-16 18:45:10 UTC
Subject: Re:  [AIX] g++ -maix64 generates illeagal assembler code 

>>>>> dhazeghi@yahoo com writes:

Dara> would you mind commenting on the status of this bug? Is this in fact a duplicate of bug 387? 

	This does appear to be a duplicate of bug 378 (not 387).

David
Comment 8 Dara Hazeghi 2003-06-16 19:12:10 UTC
Duplicate of 378 (thanks David, sorry for calling it 387).

*** This bug has been marked as a duplicate of 378 ***