[Bug c/65325] New: float/interger operation needs cast with 02 switch.

2015-03-05 Thread scerv...@connected-labs.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65325

Bug ID: 65325
   Summary: float/interger operation needs cast with 02 switch.
   Product: gcc
   Version: 4.9.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: [email protected]

A bug has been reported to gstreamer bug tracker: 

https://bugzilla.gnome.org/show_bug.cgi?id=745667

This bug seems to be related to gcc optimization behaviour. The operations
needs specific cast for operation with double and integers.


[Bug c/65325] float/interger operation needs cast with 02 switch.

2015-03-05 Thread scerv...@connected-labs.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65325

--- Comment #4 from Stephane Cerveau  ---
http://pastebin.com/stQFwaSg

Here is a sample which is supposed to describe the same behaviour as in
gstvolume.c but i'm not able to reproduce it with this code.

Here is my build command line:

arm-oad-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=hard
-mfpu=neon -mtune=cortex-a9 -O2 -pipe -g -feliminate-unused-debug-types
test_float.c -o test_float


[Bug c/65325] float/interger operation needs cast with 02 switch.

2015-03-05 Thread scerv...@connected-labs.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65325

--- Comment #5 from Stephane Cerveau  ---
Created attachment 34963
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34963&action=edit
assembly code

Here is the command line:

arm-oad-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=hard
-mfpu=neon -mtune=cortex-a9
--sysroot=/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/sysroots/jupiter
-std=gnu99 -DHAVE_CONFIG_H -I.
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/work/cortexa9hf-vfp-neon-mx6-oad-linux-gnueabi/gstreamer1.0-plugins-base/1.4.1-r0/gst-plugins-base-1.4.1/gst/volume
-I../..
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/work/cortexa9hf-vfp-neon-mx6-oad-linux-gnueabi/gstreamer1.0-plugins-base/1.4.1-r0/gst-plugins-base-1.4.1/gst-libs
-I../../gst-libs -pthread
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/sysroots/jupiter/usr/include/gstreamer-1.0
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/sysroots/jupiter/usr/include/glib-2.0
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/sysroots/jupiter/usr/lib/glib-2.0/include
-pthread
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/sysroots/jupiter/usr/include/glib-2.0
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/sysroots/jupiter/usr/lib/glib-2.0/include
-pthread
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/sysroots/jupiter/usr/include/gstreamer-1.0
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/sysroots/jupiter/usr/include/glib-2.0
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/sysroots/jupiter/usr/lib/glib-2.0/include
-DG_THREADS_MANDATORY -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT -Wall
-Wdeclaration-after-statement -Wvla -Wpointer-arith -Wmissing-declarations
-Wmissing-prototypes -Wredundant-decls -Wundef -Wwrite-strings
-Wformat-nonliteral -Wformat-security -Winit-self -Wmissing-include-dirs
-Waddress -Waggregate-return -Wno-multichar -Wnested-externs
-I/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/sysroots/jupiter/usr/include/orc-0.4
-O2 -pipe -g -feliminate-unused-debug-types -S
/home/sce/DEV/yocto-oad-dizzy/build_oad-jupiter/tmp/work/cortexa9hf-vfp-neon-mx6-oad-linux-gnueabi/gstreamer1.0-plugins-base/1.4.1-r0/gst-plugins-base-1.4.1/gst/volume/gstvolume.c
 -fPIC -DPIC -o .libs/libgstvolume_la-gstvolume.o


[Bug c/65325] float/interger operation needs cast with 02 switch.

2015-03-06 Thread scerv...@connected-labs.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65325

--- Comment #7 from Stephane Cerveau  ---
It is already without the cast ...


[Bug c/65325] float/interger operation needs cast with 02 switch.

2015-03-06 Thread scerv...@connected-labs.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65325

--- Comment #8 from Stephane Cerveau  ---
Created attachment 34973
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34973&action=edit
assembly code

This is the version with float casting