Possible PPC GCC Bug??

Possible PPC GCC Bug??

Post by David Marti » Wed, 06 Sep 2000 15:47:45




> To all PPC Linux users:

> Perhaps it's just me but the following program reports `FAIL', for no
> apparent reason. Before I start accusing the compiler or the hardware
> of being buggy(!), I would like to know whether other PPC Linux users
> get a similar report...

> I would be grateful if people will try it out. If/When replying, give
> machine and compiler specs also, please, e.g.:

> Machine:  Apple iBook SE (G3)
> Compiler: gcc version 2.95.2 19991024 (release)
> Report:   FAIL

> Francis J Franklin

> ---------------------------------------------------------------------
> #include <stdio.h>

> int test4bug (size_t one, size_t two,size_t three,size_t four,
>               size_t five,size_t six,size_t seven,
>               double* ptr_1,size_t size_1,
>               double  extraneous,
>               double* ptr_2,size_t size_2)
> {  int status = 0;

> /* fputs ("test4bug: ",stdout);

>    fprintf (stdout,"%p ?= %p, ",ptr_1, ptr_2);
>    fprintf (stdout,"%u ?= %u: ",size_1,size_2);
>  */
>    if (ptr_1  != ptr_2)  status++;
>    if (size_1 != size_2) status++;

>    if (status) fputs ("FAIL\n",stdout);
>    else        fputs ("PASS\n",stdout);

>    return (status);
> }

> int main ()
> {  double ptr[] = {0,1,2,3,4,5,6,7,8,9};

>    size_t size = sizeof ptr;

>    return (test4bug (1,2,3,4,5,6,7,ptr,size,0.0,ptr,size));
> }

Running on an old world 300Mhz G3 Tower with YDL1.2 and gcc version 2.95
(using the YDL gcc-2.95.2-1i rpm), I get a pass.

--

Materials Engineering Laboratory,
Mechanical Engineering Department,
University of Oulu
PO Box 4200
Oulun Yliopisto 90014 FINLAND

 
 
 

Possible PPC GCC Bug??

Post by Francis James Frankl » Thu, 07 Sep 2000 18:53:33


Thanks to everyone who replied. FYI, upgrading to gcc-2.95.3 removed the problem.

Thanks again,
Frank



|> Hi,
|>
|> It passes on my machine.  There have been a number of gcc fixes in how
|> parameters are passed on the outgoing parameer stack (i.e when all allowed gpr
|> and/or fpr registers are used up passing other parameters).
|>

|> gcc-2.95.3-2c
|>
|>
|> Try upgrading to the very latest binutils and gcc from Franz Sirl (member of the
|> gcc development team) from:
|>

|> >
|> > To all PPC Linux users:
|> >
|> > Perhaps it's just me but the following program reports `FAIL', for no
|> > apparent reason. Before I start accusing the compiler or the hardware
|> > of being buggy(!), I would like to know whether other PPC Linux users
|> > get a similar report...
|> >
|> > Machine:  Apple iBook SE (G3)
|> > Compiler: gcc version 2.95.2 19991024 (release)
|> > Report:   FAIL

 
 
 

1. bug in gcc for ppc

I'm trying to port something from an Alpha to run under Linux; the following
code compiles fine on an x86 machine, but has problems compiling for a PPC
(gcc version 2.7.2.1-ppclinux). I get the following error when I compile it:

test.c: In function `rmul':
test.c:15: internal error--unrecognizable insn:
(insn 47 45 49 (set (reg:DI 93)
        (plus:DI (reg:DI 90)
            (const_int 4194304))) -1 (nil)
    (nil))
cc: Internal compiler error: program cc1 got fatal signal 6

Here's the code that caused it; compile with -DBUG to get the error,
without to get the equivalent code that compiles correctly:

typedef unsigned long long      sixty;

#define MASK24  000000000000077777777LL
#define BIT22   000000000000020000000LL

void    rmul(sixty v1, sixty v2)
{
        sixty   middle;
#if     BUG
        middle = BIT22 + (v1 & MASK24) * (v2 >> 24);
#else
        middle = BIT22;
        middle += (v1 & MASK24) * (v2 >> 24);
#endif

I'm not sure who to report this to, since it seems to be a bug only with
the PPC version.

Also, is there a known bug with optimization for PPC with this version? I
get some incorrect results if I turn on -O3 which doesn't happen if I leave
optimization off.

2. Sound on Thinkpad 750 ?

3. Possible bug in libgcc.sa (GCC 2.5.7, libc 4.5.8)

4. header files for kmalloc()

5. 2.5.66 new fbcon oops while loading X / possible gcc bug?

6. RewriteCond and RewriteRule

7. Compilation problem in ndisc.c / 2.5.1-pre2 : possible gcc bug?

8. Unresolved symbols in module...

9. Is it possible to use ADSL modem in SUSE PPC?

10. linux 2.4-test kernel on PPC bugs: breaks gdb 5.0, also fbcon

11. Solaris/PPC: gcc binaries

12. Linux 2.4.16 Bug (PPC)

13. Mandrake 8.2 PPC bug or something?