public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/15517] New: -O2 and higher removes some static const
@ 2004-05-18 23:35 td at pre-secure dot de
  2004-05-18 23:37 ` [Bug c/15517] " td at pre-secure dot de
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: td at pre-secure dot de @ 2004-05-18 23:35 UTC (permalink / raw)
  To: gcc-bugs

The problem arises with ffmpeg/libavcodec (no version known) included in
transcode 0.6.11 (http://www.theorie.physik.uni-goettingen.de/~ostreich/transcode/)


# Cmdline triggering the bug (sources configured with a plain ./configure)

/tmp/gcc/transcode-0.6.11/ffmpeg/libavcodec>  gcc -DHAVE_CONFIG_H -I../.. -I.
-I../.. -I. -I../../    -O2 -g -Wall -ffast-math  -DARCH_X86 -DHAVE_MMX
-DHAVE_AV_CONFIG_H -D_GNU_SOURCE --include=../av_config.h -g -O3 -O3
-fomit-frame-pointer -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64 -MT dsputil_mmx.o -MD -MP -MF ".deps/dsputil_mmx.Tpo"  -c
-o dsputil_mmx.o `test -f 'i386/dsputil_mmx.c' || echo './'`i386/dsputil_mmx.c;

# Compiler output
i386/dsputil_mmx_rnd.h:362: warning: `avg_no_rnd_pixels8_l2_mmx' defined but not
used
i386/dsputil_mmx_rnd.h:409: warning: `avg_no_rnd_pixels16_l2_mmx' defined but
not used
i386/dsputil_mmx_avg.h:57: warning: `put_pixels8_l2_3dnow' defined but not used
i386/dsputil_mmx_avg.h:129: warning: `put_pixels16_l2_3dnow' defined but not used
i386/dsputil_mmx_avg.h:57: warning: `put_pixels8_l2_mmx2' defined but not used
i386/dsputil_mmx_avg.h:129: warning: `put_pixels16_l2_mmx2' defined but not used


# That's the code
/tmp/gcc/transcode-0.6.11/ffmpeg/libavcodec> grep ff_pw_.. i386/dsputil_mmx.c |
grep static
static const uint64_t ff_pw_20 __attribute__ ((aligned(8))) = 0x0014001400140014ULL;
static const uint64_t ff_pw_3  __attribute__ ((aligned(8))) = 0x0003000300030003ULL;
static const uint64_t ff_pw_16 __attribute__ ((aligned(8))) = 0x0010001000100010ULL;
static const uint64_t ff_pw_15 __attribute__ ((aligned(8))) = 0x000F000F000F000FULL;


# That's what's missing
/tmp/gcc/transcode-0.6.11/ffmpeg/libavcodec> nm dsputil_mmx.o | grep ff_pw
00000008 r ff_pw_15
00000000 r ff_pw_16
         U ff_pw_20
         U ff_pw_3


Resolution:
-----------
Replace -O2 and -O3 by -O1


Versions etc.:
--------------
# gcc -v

Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.3/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr
--with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man
--enable-languages=c,c++,f77,objc,java,ada --disable-checking --libdir=/usr/lib
--enable-libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib
--with-system-zlib --enable-shared --enable-__cxa_atexit i586-suse-linux
Thread model: posix
gcc version 3.3.3 (SuSE Linux)

# Distribution: SuSE 9.1

# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Mobile Intel(R) Pentium(R) 4 - M CPU 2.00GHz
stepping        : 7
cpu MHz         : 1998.497
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid
bogomips        : 3956.73

-- 
           Summary: -O2 and higher removes some static const
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: td at pre-secure dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: (?) i586-suse-linux
  GCC host triplet: i586-suse-linux
GCC target triplet: i586-suse-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15517


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/15517] -O2 and higher removes some static const
  2004-05-18 23:35 [Bug c/15517] New: -O2 and higher removes some static const td at pre-secure dot de
@ 2004-05-18 23:37 ` td at pre-secure dot de
  2004-05-18 23:38 ` falk at debian dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: td at pre-secure dot de @ 2004-05-18 23:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From td at pre-secure dot de  2004-05-18 13:53 -------
Created an attachment (id=6329)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6329&action=view)
preprocessed file

Produced by the same commandline as in the report with '-save-temps' added

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15517


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/15517] -O2 and higher removes some static const
  2004-05-18 23:35 [Bug c/15517] New: -O2 and higher removes some static const td at pre-secure dot de
  2004-05-18 23:37 ` [Bug c/15517] " td at pre-secure dot de
@ 2004-05-18 23:38 ` falk at debian dot org
  2004-05-18 23:41 ` pinskia at gcc dot gnu dot org
  2004-05-18 23:43 ` td at pre-secure dot de
  3 siblings, 0 replies; 5+ messages in thread
From: falk at debian dot org @ 2004-05-18 23:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From falk at debian dot org  2004-05-18 13:56 -------
The compiler is free to remove unused statics. Use __attribute__((used)), as
newer ffmpeg versions already do.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15517


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/15517] -O2 and higher removes some static const
  2004-05-18 23:35 [Bug c/15517] New: -O2 and higher removes some static const td at pre-secure dot de
  2004-05-18 23:37 ` [Bug c/15517] " td at pre-secure dot de
  2004-05-18 23:38 ` falk at debian dot org
@ 2004-05-18 23:41 ` pinskia at gcc dot gnu dot org
  2004-05-18 23:43 ` td at pre-secure dot de
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-18 23:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-18 13:56 -------
This is a dup of bug 14911, well it looks like SUSE turns on -funit-at-a-time at -O2 for their 3.3.3, so 
using the same method as mentioned in the other bug except change the "__GNUC_MINOR__ >=4" to 
be "__GNUC_MINOR__ >= 3" and it will work.

*** This bug has been marked as a duplicate of 14911 ***

*** This bug has been marked as a duplicate of 14911 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15517


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/15517] -O2 and higher removes some static const
  2004-05-18 23:35 [Bug c/15517] New: -O2 and higher removes some static const td at pre-secure dot de
                   ` (2 preceding siblings ...)
  2004-05-18 23:41 ` pinskia at gcc dot gnu dot org
@ 2004-05-18 23:43 ` td at pre-secure dot de
  3 siblings, 0 replies; 5+ messages in thread
From: td at pre-secure dot de @ 2004-05-18 23:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From td at pre-secure dot de  2004-05-18 14:15 -------
Subject: Re:  -O2 and higher removes some static const

Hi,

pinskia at gcc dot gnu dot org wrote:

> *** This bug has been marked as a duplicate of 14911 ***

Thanks for the *extremely* quick response. :-) Sorry for the duplicate,
but I didn't find anything with my previous bugzilla queries.

Bye -- Till


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15517


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-05-18 14:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-18 23:35 [Bug c/15517] New: -O2 and higher removes some static const td at pre-secure dot de
2004-05-18 23:37 ` [Bug c/15517] " td at pre-secure dot de
2004-05-18 23:38 ` falk at debian dot org
2004-05-18 23:41 ` pinskia at gcc dot gnu dot org
2004-05-18 23:43 ` td at pre-secure dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).