Bug 168979 - kernel build fail with -Os
Summary: kernel build fail with -Os
Status: Closed Feedback Timeout
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-12 15:30 UTC by rozhuk.im
Modified: 2014-11-04 09:39 UTC (History)
0 users

See Also:


Attachments
file.diff (80.60 KB, patch)
2012-06-12 15:30 UTC, rozhuk.im
no flags Details | Diff
1.txt (83.69 KB, text/plain)
2012-06-12 16:41 UTC, rozhuk.im
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.