[Bug c++/38562] [4.3/4.4 regression] mysql miscompiles and causes testsuite failures

2009-01-24 Thread rguenth at gcc dot gnu dot org


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|4.3.4   |---


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



[Bug c++/38562] [4.3/4.4 regression] mysql miscompiles and causes testsuite failures

2008-12-21 Thread pinskia at gcc dot gnu dot org


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||pinskia at gcc dot gnu dot
   ||org
   Target Milestone|--- |4.3.4


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



[Bug c++/38562] [4.3/4.4 regression] mysql miscompiles and causes testsuite failures

2008-12-21 Thread pinskia at gcc dot gnu dot org


--- Comment #8 from pinskia at gcc dot gnu dot org  2008-12-21 22:48 ---
Does compiling with -O2 -fno-strict-aliasing fix the issue.  I thought I saw
some aliasing violations in the source dealing with accessing a char * as a
Log_event::Byte* (aka unsigned char *).  Now what is only defined is the
accessing anything by a char/unsigned char/signed char, accessing pointers via
a different type is undefined.  The function which I saw the issue is in
copy_str_and_move where there are going to be accesses in those two types.


-- 


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



[Bug c++/38562] [4.3/4.4 regression] mysql miscompiles and causes testsuite failures

2008-12-21 Thread kees at outflux dot net


--- Comment #9 from kees at outflux dot net  2008-12-22 01:01 ---
Yes!  Adding -fno-strict-aliasing to a normal (-O2) build seems to have fixed
the problems so far.  The full test suite takes a while, but the early failures
are not present any more.  I will report more once it finishes.  Thank you for
the hint!

Is this a regression in gcc, or is this something upstreams need to add to
their builds when doing the char/pointer manipulations you described?


-- 


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



[Bug c++/38562] [4.3/4.4 regression] mysql miscompiles and causes testsuite failures

2008-12-21 Thread pinskia at gcc dot gnu dot org


--- Comment #10 from pinskia at gcc dot gnu dot org  2008-12-22 01:06 
---
(In reply to comment #9)
 Is this a regression in gcc, or is this something upstreams need to add to
 their builds when doing the char/pointer manipulations you described?

Most likely a bug in the mysql sources.  Does compiling with -W -Wall produce
any warnings (when compiling with just -O2)?


-- 


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



[Bug c++/38562] [4.3/4.4 regression] mysql miscompiles and causes testsuite failures

2008-12-21 Thread pinskia at gcc dot gnu dot org


--- Comment #11 from pinskia at gcc dot gnu dot org  2008-12-22 01:10 
---
I do get a warning from the trunk though:
log_event.cc: In member function 'virtual bool
Query_log_event::write(IO_CACHE*)':
log_event.cc:1124: warning: dereferencing pointer 'start.519' does break
strict-aliasing rules
log_event.cc:1217: note: initialized from here

Which is exactly what I mentioned except it is a different place I was thinking
of:

write_str_with_code_and_len((char **)(start),
catalog, catalog_len, 6);


Yes this is now becomes an obvious aliasing issue as you are a unsigned char
* as a char * which violates C/C++ aliasing rules.

Please report this bug to mysql.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID


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



[Bug c++/38562] [4.3/4.4 regression] mysql miscompiles and causes testsuite failures

2008-12-17 Thread kees at outflux dot net


--- Comment #7 from kees at outflux dot net  2008-12-18 01:07 ---
Created an attachment (id=16925)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16925action=view)
4.4.0 -E output of log_event.cc (bzip2)

$ /usr/lib/gcc-snapshot/bin/g++ -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME=\/usr\
-DDATADIR=\/var/lib/mysql\ -DSHAREDIR=\/usr/share/mysql\
-DHAVE_CONFIG_H -I. -I. -I../include -I../innobase/include
-I../innobase/include -I../ndb/include -I../ndb/include -I../ndb/include/ndbapi
-I../ndb/include/mgmapi -I../include -I../include -I../regex -I. -DDBUG_OFF
-DBIG_JOINS=1 -felide-constructors -fno-rtti -O1   -fno-implicit-templates
-fno-exceptions -fno-rtti  -MT log_event.o -MD -MP -MF .deps/log_event.Tpo -E
log_event.cc  /tmp/log_event.cc-E


-- 


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