Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 440306 - strip-flags appends -O2 even when it shouldn't
Summary: strip-flags appends -O2 even when it shouldn't
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-30 18:27 UTC by Denis M. (Phr33d0m)
Modified: 2012-10-30 20:51 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denis M. (Phr33d0m) 2012-10-30 18:27:54 UTC
Example:

x86_64-pc-linux-gnu-gcc -c -march=native -O2 -pipe -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o nasm.o nasm.c
x86_64-pc-linux-gnu-gcc -c -march=native -O2 -pipe -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o ver.o ver.c
x86_64-pc-linux-gnu-gcc -c -march=native -O2 -pipe -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o raa.o raa.c
x86_64-pc-linux-gnu-gcc -c -march=native -O2 -pipe -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o saa.o saa.c
x86_64-pc-linux-gnu-gcc -c -march=native -O2 -pipe -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o rbtree.o rbtree.c
x86_64-pc-linux-gnu-gcc -c -march=native -O2 -pipe -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o float.o float.c
x86_64-pc-linux-gnu-gcc -c -march=native -O2 -pipe -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o insnsa.o insnsa.c
x86_64-pc-linux-gnu-gcc -c -march=native -O2 -pipe -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o insnsb.o insnsb.c
x86_64-pc-linux-gnu-gcc -c -march=native -O2 -pipe -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o directiv.o directiv.c
x86_64-pc-linux-gnu-gcc -c -march=native -O2 -pipe -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o assemble.o assemble.c



Reproducible: Always
Comment 1 Denis M. (Phr33d0m) 2012-10-30 18:33:10 UTC
# ▶ emerge --info | grep CFLAGS
49:CFLAGS="-march=native -O2 -pipe"
Comment 2 Mr. Bones. (RETIRED) gentoo-dev 2012-10-30 19:47:42 UTC
That's a bug in strip-flags.  This code doesn't work:

        if _is_flagq ${var} "-O*" && ! _is_flagq new "-O*" ; then
            new+=( -O2 )
        fi
Comment 4 Mr. Bones. (RETIRED) gentoo-dev 2012-10-30 20:42:08 UTC
That doesn't fix the problem.  The current code for _is_flagq doesn't support arrays.
Comment 5 Mr. Bones. (RETIRED) gentoo-dev 2012-10-30 20:43:33 UTC
CFLAGS=-march=native -O2 -pipe -Wall -Wno-pointer-sign

works to show the issue.