Bug 168979

Summary: kernel build fail with -Os
Product: Base System Reporter: rozhuk.im
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed Feedback Timeout    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff
none
1.txt none

Description rozhuk.im 2012-06-12 15:30:05 UTC
"warning: 'XXX' may be used uninitialized in this function" in many places.


..
cc -c -Os -fno-strict-aliasing -pipe -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs -fdiagnostics-show-option   -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000  -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror  /usr/src/sys/cam/scsi/scsi_sa.c
cc1: warnings being treated as errors
/usr/src/sys/cam/scsi/scsi_sa.c: In function 'samount':
/usr/src/sys/cam/scsi/scsi_sa.c:1887: warning: 'comp_supported' may be used uninitialized in this function
/usr/src/sys/cam/scsi/scsi_sa.c:1888: warning: 'write_protect' may be used uninitialized in this function
/usr/src/sys/cam/scsi/scsi_sa.c:1887: warning: 'comp_enabled' may be used uninitialized in this function
/usr/src/sys/cam/scsi/scsi_sa.c:2728: warning: 'current_speed' may be used uninitialized in this function
/usr/src/sys/cam/scsi/scsi_sa.c:2728: note: 'current_speed' was declared here
/usr/src/sys/cam/scsi/scsi_sa.c:2727: warning: 'current_density' may be used uninitialized in this function
/usr/src/sys/cam/scsi/scsi_sa.c:2727: note: 'current_density' was declared here
/usr/src/sys/cam/scsi/scsi_sa.c:2725: warning: 'current_blocksize' may be used uninitialized in this function
/usr/src/sys/cam/scsi/scsi_sa.c:2725: note: 'current_blocksize' was declared here
/usr/src/sys/cam/scsi/scsi_sa.c:2728: warning: 'current_speed' may be used uninitialized in this function
/usr/src/sys/cam/scsi/scsi_sa.c:2728: note: 'current_speed' was declared here
/usr/src/sys/cam/scsi/scsi_sa.c:2725: warning: 'current_blocksize' may be used uninitialized in this function
/usr/src/sys/cam/scsi/scsi_sa.c:2725: note: 'current_blocksize' was declared here
/usr/src/sys/cam/scsi/scsi_sa.c:2728: warning: 'current_speed' may be used uninitialized in this function
/usr/src/sys/cam/scsi/scsi_sa.c:2728: note: 'current_speed' was declared here
/usr/src/sys/cam/scsi/scsi_sa.c:2725: warning: 'current_blocksize' may be used uninitialized in this function
/usr/src/sys/cam/scsi/scsi_sa.c:2725: note: 'current_blocksize' was declared here
/usr/src/sys/cam/scsi/scsi_sa.c:2728: warning: 'current_speed' may be used uninitialized in this function
/usr/src/sys/cam/scsi/scsi_sa.c:2728: note: 'current_speed' was declared here
/usr/src/sys/cam/scsi/scsi_sa.c:2725: warning: 'current_blocksize' may be used uninitialized in this function
/usr/src/sys/cam/scsi/scsi_sa.c:2725: note: 'current_blocksize' was declared here
*** Error code 1

Stop in /usr/obj/usr/src/sys/GENERIC.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
Exit 1

Fix: Attached patch does not fix all errors:
--param large-function-growth limit reached [-Winline]
exists

Patch attached with submission follows:
How-To-Repeat: cd /usr/src/
make buildkernel
Comment 1 rozhuk.im 2012-06-12 16:41:52 UTC
Some patch fixes.