Miscompare of 254.gap in SPEC's cpu000 using 2014.05 Aarch64 release

Bug #1330725 reported by frank smith on 2014-06-16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro GCC
Kugan Vivekanandarajah

Bug Description

I have been building SPEC's cpu200 suite using the 2014.05 aarch64 release. The benchmark call 254.gap fails to correctly run ( fails to compare in SPEC nomenclature ) using the following flags

* COMP: /opt/gcc-linaro-aarch64-linux-gnu-4.9-2014.05_linux/bin/aarch64-linux-gnu-gcc -c -o options.o -static -g -DSYS_HAS_SIGNAL_PROTO -DSYS_HAS_MALLOC_PROTO -DSYS_HAS_CALLOC_PROTO -DSYS_IS_USG -DSYS_HAS_IOCTL_PROTO -DSYS_HAS_TIME_PROTO -DSPEC_CPU2000_LP64 -O3 -march=armv8-a+crypto -static -g
LINK: /opt/gcc-linaro-aarch64-linux-gnu-4.9-2014.05_linux/bin/aarch64-linux-gnu-gcc -O3 -march=armv8-a+crypto -static -g -static -g -lm -o options

* COMP: /opt/gcc-linaro-aarch64-linux-gnu-4.9-2014.05_linux/bin/aarch64-linux-gnu-gcc -c -o options.o -static -g -DSYS_HAS_SIGNAL_PROTO -DSYS_HAS_MALLOC_PROTO -DSYS_HAS_CALLOC_PROTO -DSYS_IS_USG -DSYS_HAS_IOCTL_PROTO -DSYS_HAS_TIME_PROTO -DSPEC_CPU2000_LP64 -O2 -march=armv8-a+crypto -static -g
LINK: /opt/gcc-linaro-aarch64-linux-gnu-4.9-2014.05_linux/bin/aarch64-linux-gnu-gcc -O2 -march=armv8-a+crypto -static -g -static -g -lm -o options

However it does generate a correct answer once it drops to -O1 and -O0

Normally I would assume the -O3 was too aggressive but this built at -O3 level and ran with no problems in the 2014.04 release of the Aarch64 compiler. So this is a regression from your previous release.

frank smith (smithfra) wrote :

I have started running with arm gnueabihf 2014.05 version and get the same failiure in 254.gap at the -o3 level. I will work the -O flag back once everything else completes.

However, this is a regression. 254.gap worked in the 2014.04 release at -O3.
/opt/gcc-linaro-arm-linux-gnueabihf-4.9-2014.05_linux/bin/arm-linux-gnueabihf-gcc -O3 -march=armv7-a -mfpu=vfpv3-d16 -fno-use-linker-plugin -flto -marm -mfloat-abi=hard -ffast-math -ftree-vectorize -g -static -static agcollec.o aggroup.o blister.o coding.o costab.o cyclotom.o eval.o finfield.o function.o gap.o gasman.o idents.o integer.o list.o pcpresen.o permutat.o plist.o polynom.o range.o rational.o read.o record.o scanner.o set.o statemen.o string.o system.o tietze.o unknown.o vecffe.o vector.o word.o -lm -o gap

Changed in gcc-linaro:
assignee: nobody → Kugan Vivekanandarajah (kugan-vivekanandarajah)
frank smith (smithfra) wrote :

Changing to -O2 it failed to compare (same as at -O3) and at -O1 it ran successfully.

254.gap has undefined signed integer overflow and therefore needs -fno-strict-overflow to avoid the undefined behaviour.

Please refer to the https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57124

frank smith (smithfra) wrote :

Adding -fno-strict-overflow fixed the miscompare problem for both the AArch64 and ARMHF 2014.05 toolchains.

I do not know if this is important anymore but this was NOT needed, to get a correct result, when running the AArch64 & ARMHF 2014.04 toolchains.

It is undefined behaviour on the part of application code. Being undefined, gcc wouldn’t give any guarantee and hence it could work or not work depending on what happens in the optimization passes. working with 2014.04 dosent mean that it should work always. I am going to close this as Invalid.

Changed in gcc-linaro:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.