[Bug c/30595] New: gcc3.4.6 generates incorrect ppc32 code for combination of bitfields and shifts

2007-01-25 Thread ISPARRY at BROCADE dot COM
The code generated for a ppc32 for the 1 line function f below is incorrect.
Not that it should matter but this is a cross compiler, built with cross-tool.

typedef struct {
unsigned char c;
unsigned int i:24;
} e_t;

f(e_t *p)
{
p->i<<= 8;
}

#include 
int
main(int argc, char *argv[])
{
e_t x = { .c='a', .i=0x12345 };
f(&x);
printf("(0x12345 << 8 ) & 0xff = %x\n", x.i);
}

Compiled with "-O".
The output is
(0x12345 << 8 ) & 0xff = 234561
The bottom 8 bits should be zero, not the contents of x.c.
If one comments out the driver function, so all that you are left with is the f
function, one gets the following assembler. I have added pseudo-C comments.


.file   "t.c"
.section".text"
.align 2
.globl f
.type   f, @function
f:
lwz 9,0(3)  ;; r9 = *p
mr 0,9  ;; r0 = r9
rlwimi 0,9,8,8,31   ;; low24(r0) = low24(rotate8(r9)) ** Wrong
stw 0,0(3)  ;; *p = r0
blr ;; return
.size   f, .-f
.section.note.GNU-stack,"",@progbits
.ident  "GCC: (GNU) 3.4.6"

gcc2.95 generates the correct code, and answer
(0x12345 << 8 ) & 0xff = 234500


-- 
   Summary: gcc3.4.6 generates incorrect ppc32 code for combination
of bitfields and shifts
   Product: gcc
   Version: 3.4.6
Status: UNCONFIRMED
  Severity: critical
  Priority: P3
         Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ISPARRY at BROCADE dot COM
 GCC build triplet: i686-host_pc-linux-gnu
  GCC host triplet: i686-host_pc-linux-gnu
GCC target triplet: powerpc-unknown-linux-gnu


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



[Bug c/19541] need another option to support what -I- did just besides -iquote

2008-01-18 Thread ISPARRY at BROCADE dot COM


--- Comment #9 from ISPARRY at BROCADE dot COM  2008-01-19 00:53 ---
(In reply to comment #8)
> Changing component; the patch here doesn't touch the preprocessor at all.
> 

If you are changing the component, would not a better choice be "driver" than
"c"? 

I agree the patch does not touch the preprocessor code, but from a user point
of view it is a preprocessor issue. The 4.2.2 manuals say in section 3.11 that
"The preprocessor's direct interface is undocumented and subject to change, so
whenever possible you should avoid using -Wp and let the driver handle the
options instead." A user could reasonably (but wrongly) assume that the driver
passes options like -I to the preprocessor.

If you are changing the component, then can you change the severity to
something more suitable than "enhancment" at the same time? Whilst I am all in
favour of emitting warnings about obsolete features, until there is a working
replacement for -I- it is a bug to complain that it is deprecated.


-- 


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



[Bug preprocessor/34855] New: Bug 19541 is still not resolved in 4.3.0

2008-01-18 Thread ISPARRY at BROCADE dot COM
This is bug 19541, but being reported against 4.3.0.

Still a problem in 4.3.using Debian unstable packages
gcc --version gives gcc-4.3 (Debian 4.3-20080116-1) 4.3.0 20080116
(experimental) [trunk revision 131577]

Can we either get the "ignore-source-dir" patch added to the mainline, or else
remove the "-I- is deprecated" warning? Clearly there are uses for -I-, as the
mailing list thread shows.


-- 
   Summary: Bug 19541 is still not resolved in 4.3.0
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: preprocessor
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: ISPARRY at BROCADE dot COM


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



[Bug preprocessor/34857] New: Bug 19541 is still not resolved in 4.3.0

2008-01-18 Thread ISPARRY at BROCADE dot COM
This is bug 19541, but being reported against 4.3.0.

Still a problem in 4.3.using Debian unstable packages
gcc --version gives gcc-4.3 (Debian 4.3-20080116-1) 4.3.0 20080116
(experimental) [trunk revision 131577]

Can we either get the "ignore-source-dir" patch added to the mainline, or else
remove the "-I- is deprecated" warning? Clearly there are uses for -I-, as the
mailing list thread shows.


-- 
   Summary: Bug 19541 is still not resolved in 4.3.0
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: preprocessor
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: ISPARRY at BROCADE dot COM


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



[Bug preprocessor/34855] Bug 19541 is still not resolved in 4.3.0

2008-01-18 Thread ISPARRY at BROCADE dot COM


--- Comment #3 from ISPARRY at BROCADE dot COM  2008-01-18 19:59 ---
(In reply to comment #2)
> And that bug is still opened.
> 
> *** This bug has been marked as a duplicate of 19541 ***
> 

Yes. 3 years after a fix is available, and 3 releases of gcc, the bug is still
open. Can we get it closed please?


-- 


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



[Bug preprocessor/34855] Bug 19541 is still not resolved in 4.3.0

2008-01-18 Thread ISPARRY at BROCADE dot COM


--- Comment #5 from ISPARRY at BROCADE dot COM  2008-01-18 20:12 ---
(In reply to comment #4)
> Patches welcome.
> 

Ceratinly. I can either up-rev the patch posted in
http://gcc.gnu.org/ml/gcc-patches/2006-03/msg01197.html or I can do a patch to
undo the deprecation of -I-. Which stands any chance of being accepted?

My preference is to undo the deprecation of -I-, as it is used by other
compilers.


-- 


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



[Bug middle-end/30595] gcc3.4.6 generates incorrect ppc32 code for combination of bitfields and shifts

2009-02-06 Thread ISPARRY at BROCADE dot COM


--- Comment #3 from ISPARRY at BROCADE dot COM  2009-02-06 21:25 ---
Subject: RE:  gcc3.4.6 generates incorrect ppc32 code for combination of
bitfields and shifts

Whilst I am not complaining about 3.4 not being supported, I think it is
a pretty poor show that you are not able to reproduce it. Did anyone
even try?


> -Original Message-
> From: steven at gcc dot gnu dot org [mailto:gcc-bugzi...@gcc.gnu.org] 
> Sent: Friday, February 06, 2009 1:16 PM
> To: Icarus Sparry
> Subject: [Bug middle-end/30595] gcc3.4.6 generates incorrect 
> ppc32 code for combination of bitfields and shifts
> 
> 
> 
> --- Comment #2 from steven at gcc dot gnu dot org  
> 2009-02-06 21:15 --- Not reproducible, and gcc 3.4 is not 
> supported anymore.
> 
> 
> -- 
> 
> steven at gcc dot gnu dot org changed:
> 
>What|Removed |Added
> --
> --
>  Status|UNCONFIRMED |RESOLVED
>  Resolution||WONTFIX
> 
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30595
> 
> --- You are receiving this mail because: --- You 
> reported the bug, or are watching the reporter.
> 


-- 


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