c/7330: ICE with dereferenced "void *" pointer

christian.lestrade@free.fr christian.lestrade@free.fr
Tue Jul 16 08:36:00 GMT 2002


>Number:         7330
>Category:       c
>Synopsis:       ICE with dereferenced "void *" pointer
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 16 08:36:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Christian Lestrade
>Release:        3.1
>Organization:
>Environment:
System: Linux byzance 2.4.18 #4 Fri May 31 01:25:31 PDT 2002 i686 unknown
Architecture: i686

host: i386-slackware-linux-gnu
build: i386-slackware-linux-gnu
target: i386-slackware-linux-gnu
configured with: ../gcc-3.1/configure --prefix=/usr --enable-shared --with-gnu-
ld --enable-threads --verbose --target=i386-slackware-linux --host=i386-
slackware-linux
>Description:
When compiling Linux ABI kernel extension (http://linux-abi.sourceforge.net/),
I get the following error:

gcc -D__KERNEL__ -I/usr/src/linux-2.4.18/include -Wall -Wstrict-prototypes -Wno-
trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -
mpreferred-stack-boundary=2 -march=i386 -DMODULE  -DKBUILD_BASENAME=sysi86  -c -
o sysi86.o sysi86.c
sysi86.c: In function `svr4_sysi86':
sysi86.c:132: warning: dereferencing `void *' pointer
sysi86.c:132: warning: dereferencing `void *' pointer
sysi86.c:132: warning: dereferencing `void *' pointer
sysi86.c:132: warning: dereferencing `void *' pointer
sysi86.c:132: warning: dereferencing `void *' pointer
sysi86.c:154: warning: implicit declaration of function `si_meminfo'
sysi86.c:132: Internal compiler error in emit_move_insn_1, at expr.c:3101
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

>How-To-Repeat:
gzip -d sysi86.i.gz
gcc -c sysi86.i
with attached file sysi86.i.gz

>Fix:

In the source code, add a cast before arg1:
--- sysi86.c    2002-07-16 16:53:58.000000000 +0200
+++ sysi86-fixed.c      2002-07-16 16:56:14.000000000 +0200
@@ -129,7 +129,7 @@
                 * least. For now let's lie...
                 * (actually SCO Unix 3.4 gives me -1...)
                 */
-               return put_user(FP_387, arg1);
+               return put_user(FP_387, (int *)arg1);
        case STIME:
                /*
                 * Set the system time. The argument is a long,

---MOQ102683344585aa51da12196418ab5bc08c7829c424
Content-Type: application/x-gzip-compressed; name="sysi86.i.gz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="sysi86.i.gz"



---MOQ102683344585aa51da12196418ab5bc08c7829c424--
>Release-Note:
>Audit-Trail:
>Unformatted:
 This message is in MIME format.
 
 ---MOQ102683344585aa51da12196418ab5bc08c7829c424
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: 8bit
 



More information about the Gcc-prs mailing list