public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/22565] New: GCC 3.4.1 Complex cast error in a kernel module compilation
@ 2005-07-20  8:59 erwann dot houzay at laposte dot net
  2005-07-20 11:42 ` [Bug c/22565] " giovannibajo at libero dot it
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: erwann dot houzay at laposte dot net @ 2005-07-20  8:59 UTC (permalink / raw)
  To: gcc-bugs

I've found the following bug compiling the c code below: 
 
/root/Interface_thread_buffered/RTAI_GYRO.c: In function `fill_data_gyro': 
/root/Interface_thread_buffered/RTAI_GYRO.c:68: error: unrecognizable insn: 
(insn:HI 87 86 88 0 (set (reg:DF 112) 
        (float:DF (reg:HI 113))) -1 (insn_list 86 (nil)) 
    (expr_list:REG_DEAD (reg:HI 113) 
        (nil))) 
/root/Interface_thread_buffered/RTAI_GYRO.c:68: internal compiler error: in 
extract_insn, at recog.c:2083 
Please submit a full bug report, 
with preprocessed source if appropriate. 
 
The "fill_data_gyro" function contain the following code: 
 
int fill_data_gyro(unsigned char *buf, double *angle){ 
	unsigned char c; 
	unsigned char R[2]; 
	 
	char cs;              //CheckSum recupere  
	unsigned char cs_add; //Checkum calcule 
	 
	//Constantes constructeur 
	double LSB_Angle=0.000305; 
 
	----------- 
 
	R[1] = (buf[5]<<6) | (buf[6]>>1);       //c=R15-----R8 
        cs_add+=R[1] & 0xff ; 
	 
	R[0] = buf[6]<<7 | buf[7];  //c=R7-----R0 
	cs_add+=R[0] & 0xff; 
 
	* angle= -LSB_Angle * (* (short *) &R); 
		 
	----------- 
 
	return 0; 
} 
 
Commenting the "* angle= -LSB_Angle * (* (short *) &R);" the complilation work 
perfectly 
 
The makefile is the following: 
 
SOURCES  = RTAI_GYRO.c 
 
obj-m	:= $(SOURCES:.c=.o) 
RTAI     = /usr/realtime 
EXTRA_CFLAGS   = -I$(RTAI)/include -I/usr/include/ 
KDIR	:= /lib/modules/$(shell uname -r)/build 
PWD	:= $(shell pwd) 
 
 
default: 
	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules 
 
(it's a kernel module for RTAI...) 
 
I've compiled this code inside an other application and it works perfectly 
even with the "* angle= -LSB_Angle * (* (short *) &R);" line... 
 
The gcc options associated: gcc -Wall -g -lm .... 
 
I'm a neaby in Linux and it's possible that this kind of cast (* (short *) &R) 
is not very clear for the compiler (....the star represents alternatively a 
pointeur and the multiplication symbol...) 
 
I hope not to report a know bug... 
 
My system is a Mdk 10.1 with a 2.6.7 kernel from kernel.org....(I need a 
standard kernel for RTAI developping....)  
 
bye 
 
Erwann

-- 
           Summary: GCC 3.4.1 Complex cast error in a kernel module
                    compilation
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: erwann dot houzay at laposte dot net
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c/22565] GCC 3.4.1 Complex cast error in a kernel module compilation
  2005-07-20  8:59 [Bug c/22565] New: GCC 3.4.1 Complex cast error in a kernel module compilation erwann dot houzay at laposte dot net
@ 2005-07-20 11:42 ` giovannibajo at libero dot it
  2005-07-21  5:33 ` [Bug target/22565] " pinskia at gcc dot gnu dot org
  2005-07-21  8:38 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: giovannibajo at libero dot it @ 2005-07-20 11:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2005-07-20 09:53 -------
Try again with GCC 3.4.4, and come back to us. You should always try the latest 
version of the compiler line you're using, otherwise we could all be wasting 
time on the bug report.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug target/22565] GCC 3.4.1 Complex cast error in a kernel module compilation
  2005-07-20  8:59 [Bug c/22565] New: GCC 3.4.1 Complex cast error in a kernel module compilation erwann dot houzay at laposte dot net
  2005-07-20 11:42 ` [Bug c/22565] " giovannibajo at libero dot it
@ 2005-07-21  5:33 ` pinskia at gcc dot gnu dot org
  2005-07-21  8:38 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-21  5:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-21 05:12 -------
Also supply the preprocessor source.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |target
 GCC target triplet|                            |i686-pc-linux-gnu
           Keywords|                            |ice-on-valid-code


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


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

* [Bug target/22565] GCC 3.4.1 Complex cast error in a kernel module compilation
  2005-07-20  8:59 [Bug c/22565] New: GCC 3.4.1 Complex cast error in a kernel module compilation erwann dot houzay at laposte dot net
  2005-07-20 11:42 ` [Bug c/22565] " giovannibajo at libero dot it
  2005-07-21  5:33 ` [Bug target/22565] " pinskia at gcc dot gnu dot org
@ 2005-07-21  8:38 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-21  8:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-21 08:35 -------
I got a private message saying the submitter worked around the bug and lost the orginal source code 
so I am going to close this as invalid,

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


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


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

end of thread, other threads:[~2005-07-21  8:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-20  8:59 [Bug c/22565] New: GCC 3.4.1 Complex cast error in a kernel module compilation erwann dot houzay at laposte dot net
2005-07-20 11:42 ` [Bug c/22565] " giovannibajo at libero dot it
2005-07-21  5:33 ` [Bug target/22565] " pinskia at gcc dot gnu dot org
2005-07-21  8:38 ` pinskia at gcc dot gnu dot org

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