Wind River Support Network

HomeDefectsLIN6-9585
Fixed

LIN6-9585 : GCC generates wrong code for some control flow under -O2 on X86_64

Created: Mar 16, 2015    Updated: Dec 3, 2018
Resolved Date: May 8, 2015
Found In Version: 6.0.0.16
Fix Version: 6.0.0.20
Severity: Severe
Applicable for: Wind River Linux 6
Component/s: Toolchain

Description

GCC generates wrong code  for some control flow under -O2 on X86_64.
See attached t.c for source and t.s for assembly.
The code would return wrong result in case the first function call returns ERR_NONE and the second returns 1.

Steps to Reproduce

/path/to/wrlinux-6/wrlinux/configure --enable-board=intel-x86-64 --enable-rootfs=glibc_small --enable-kernel=preempt_rt
./host-cross/usr/bin/x86_64-wrs-linux/i686-wrs-linux-gnu-gcc -O2 -m64 -S t.c

Other Downloads


Live chat
Online