Bug 96979

Summary: Internal error when overshifting integers
Product: [Retired] Red Hat Linux Reporter: Szymon Acedanski <accek>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-06-07 19:35:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
My project, with offending file 'dir.c'
none
dir.c after preprocessing none

Description Szymon Acedanski 2003-06-07 18:04:49 UTC
From Bugzilla Helper: 
User-Agent: Mozilla/5.0 (compatible; Konqueror/3; Linux) 
 
Description of problem: 
I tried to compile my own kernel module and I got 
 
dir.c:108: Internal compiler error in extract_insn, at recog.c:2148 
Please submit a full bug report, 
with preprocessed source if appropriate. 
 
[full log attached] 
 
I realized my error in source code, which stated 
 
[...] i << PAGE_CACHE_SIZE [...] 
 
where 'i' is unsigned long, and PAGE_CACHE_SIZE is #defined as 0x400. I should 
have written 'i << PAGE_CACHE_SHIFT'. 
 
Version-Release number of selected component (if applicable): 
gcc-3.2-7 
 
How reproducible: 
Always 
 
Steps to Reproduce: 
1. Just try to compile preprocessed file 'gcc-bug-source.i' with 'gcc -c 
gcc-bug-source.i'. 
2. You may also try compiling 'dir.c' according to makefile (archive 
attached). 
 
Actual Results: 
dir.c: In function `netfs_readdir': 
dir.c:103: warning: left shift count >= width of type 
dir.c:108: unrecognizable insn: 
(insn 362 360 364 (set (reg:QI 108) 
        (const_int 4096 [0x1000])) -1 (nil) 
    (nil)) 
dir.c:108: Internal compiler error in extract_insn, at recog.c:2148 
 
 
Expected Results: 
1. to print a warning, but to continue compilation (extra shifting could 
produce 0 by "overshifting" all bits). 
2. or just boil out with error message (but not such an error :) 
 
Additional info: 
 
offending line (preprocessed): 
 
fp->f_pos = (i << (1UL << 12)) | offset;

Comment 1 Szymon Acedanski 2003-06-07 18:06:21 UTC
Created attachment 92240 [details]
My project, with offending file 'dir.c'

Comment 2 Szymon Acedanski 2003-06-07 18:07:27 UTC
Created attachment 92241 [details]
dir.c after preprocessing

Comment 3 Jakub Jelinek 2003-06-07 19:35:22 UTC
Cannot reproduce with gcc-3.2.2-5 (RHL9) or gcc-3.3-5 (rawhide).