public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "erwann dot houzay at laposte dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/22565] New: GCC 3.4.1 Complex cast error in a kernel module compilation
Date: Wed, 20 Jul 2005 08:59:00 -0000	[thread overview]
Message-ID: <20050720084734.22565.erwann.houzay@laposte.net> (raw)

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


             reply	other threads:[~2005-07-20  8:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-20  8:59 erwann dot houzay at laposte dot net [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050720084734.22565.erwann.houzay@laposte.net \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).