Bug 39435 - invalid assembly produced with -mpowerpc64 -Wa,-mppc64 -mcpu=970
Summary: invalid assembly produced with -mpowerpc64 -Wa,-mppc64 -mcpu=970
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.3.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-11 16:33 UTC by Paul Zimmermann
Modified: 2009-03-11 16:59 UTC (History)
3 users (show)

See Also:
Host: powerpc970-unknown-linux-gnu
Target: powerpc64-unknown-linux-gnu
Build: powerpc64-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Zimmermann 2009-03-11 16:33:49 UTC
The following code gives:

zimmerma@gcc40:~$ /opt/cfarm/release/4.3.3/bin/gcc -mpowerpc64 -Wa,-mppc64 -mcpu=970 -c bug.c
/tmp/ccCzXnwd.s: Assembler messages:
/tmp/ccCzXnwd.s:24: Error: junk at end of line: `1'

zimmerma@gcc40:~$ cat bug.c
typedef unsigned long long int mp_limb_t;
typedef const mp_limb_t *mp_srcptr;
typedef long int mp_size_t;
void
foo (mp_srcptr src, mp_limb_t divisor)
{
  mp_limb_t h, s;
  mp_limb_t p0;
  for (;;)
    {
      s = src[0];
      h = bar (&p0, divisor > s, divisor);
    }
}
Comment 1 Paul Zimmermann 2009-03-11 16:51:46 UTC
This problem was discovered while trying to compile GMP with ABI=mode32:
http://gmplib.org/list-archives/gmp-bugs/2009-March/001307.html

If either one of the three options -mpowerpc64 -Wa,-mppc64 -mcpu=970 is removed,
the compilation works.
Comment 2 Jakub Jelinek 2009-03-11 16:59:07 UTC
Sounds like a user error.  If you compile with -mcpu=970, you shouldn't be telling the assembler not to grok power4 or altivec instructions, which it can generate.  Just drop that -Wa,-mppc64, gcc will take care of passing the right options to gas.