[Bug other/54691] [4.8 Regression] --enable-checking=valgrind doesn't build

2012-12-03 Thread jakub at gcc dot gnu.org


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



--- Comment #13 from Jakub Jelinek jakub at gcc dot gnu.org 2012-12-03 
17:20:01 UTC ---

Author: jakub

Date: Mon Dec  3 17:19:47 2012

New Revision: 194102



URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=194102

Log:

PR bootstrap/55380

PR other/54691

* files.c (read_file_guts): Allocate extra 16 bytes instead of

1 byte at the end of buf.  Pass size + 16 instead of size

to _cpp_convert_input.

* charset.c (_cpp_convert_input): Reallocate if there aren't

at least 16 bytes beyond to.len in the buffer.  Clear 16 bytes

at to.text + to.len.



Modified:

trunk/libcpp/ChangeLog

trunk/libcpp/charset.c

trunk/libcpp/files.c


[Bug other/54691] [4.8 Regression] --enable-checking=valgrind doesn't build

2012-12-03 Thread jakub at gcc dot gnu.org


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



Jakub Jelinek jakub at gcc dot gnu.org changed:



   What|Removed |Added



 Status|NEW |RESOLVED

 CC||jakub at gcc dot gnu.org

 Resolution||FIXED



--- Comment #14 from Jakub Jelinek jakub at gcc dot gnu.org 2012-12-03 
17:29:05 UTC ---

Should be fixed now.


[Bug other/54691] [4.8 Regression] --enable-checking=valgrind doesn't build

2012-11-25 Thread rguenth at gcc dot gnu.org


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



Richard Biener rguenth at gcc dot gnu.org changed:



   What|Removed |Added



   Target Milestone|--- |4.8.0


[Bug other/54691] [4.8 Regression] --enable-checking=valgrind doesn't build

2012-11-25 Thread hjl.tools at gmail dot com


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



--- Comment #12 from H.J. Lu hjl.tools at gmail dot com 2012-11-25 22:15:22 
UTC ---

This patch:



http://gcc.gnu.org/ml/gcc-patches/2012-11/msg01973.html



works.


[Bug other/54691] [4.8 Regression] --enable-checking=valgrind doesn't build

2012-10-15 Thread ubizjak at gmail dot com


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



--- Comment #9 from Uros Bizjak ubizjak at gmail dot com 2012-10-15 07:00:15 
UTC ---

(In reply to comment #8)



 libcpp will read in advance beyond the end of buffer in

 some cases, even without SSE optimization.



I'd call this a bug.


[Bug other/54691] [4.8 Regression] --enable-checking=valgrind doesn't build

2012-10-15 Thread pinskia at gcc dot gnu.org


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



--- Comment #10 from Andrew Pinski pinskia at gcc dot gnu.org 2012-10-15 
07:05:43 UTC ---

(In reply to comment #9)

 (In reply to comment #8)

 

  libcpp will read in advance beyond the end of buffer in

  some cases, even without SSE optimization.

 

 I'd call this a bug.



No it is not a bug.  Even if the read happens, since a null character is found,

the behavior does not change.  Also it is never on an unaligned read so we can

never hit a page fault due to unmapped pages.


[Bug other/54691] [4.8 Regression] --enable-checking=valgrind doesn't build

2012-10-15 Thread hjl.tools at gmail dot com


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



--- Comment #11 from H.J. Lu hjl.tools at gmail dot com 2012-10-15 07:18:45 
UTC ---

search_line_acc_char has



  /* Align the buffer.  Mask out any bytes from before the beginning.  */

  p = (word_type *)((uintptr_t)s  -sizeof(word_type));



It is OK to pad the buffer end just to 16-byte aligned.


[Bug other/54691] [4.8 Regression] --enable-checking=valgrind doesn't build

2012-10-14 Thread ubizjak at gmail dot com


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



--- Comment #7 from Uros Bizjak ubizjak at gmail dot com 2012-10-14 16:23:04 
UTC ---

Created attachment 28445

  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=28445

Prototype patch that introduces VALGRIND_MAKE_MEM_DEFINED



Attached prototype patch builds on HJ's patch. The patch detects valgrind in

the same way as in gcc directory (actually, it just copies relevant bits) and

changes:



+  memset (to.text + to.len + 1, 0, 16);



to



+  VALGRIND_DISCARD (VALGRIND_MAKE_MEM_DEFINED (to.text + to.len + 1, 16));



(BTW: Probably, we should align end of buffer to 16 byte boundary instead of

hardcoding 16.)



(BTW2: the test in the following code in the patch is obviously wrong:



+if test $enable_checking != no ; then

+  # It is certainly possible that there's valgrind but no valgrind.h.

+  # GCC relies on making annotations so we must have both.

+  AC_MSG_CHECKING(for VALGRIND_DISCARD in valgrind/memcheck.h)

+  AC_PREPROC_IFELSE([AC_LANG_SOURCE(

...)


[Bug other/54691] [4.8 Regression] --enable-checking=valgrind doesn't build

2012-10-14 Thread hjl.tools at gmail dot com


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



--- Comment #8 from H.J. Lu hjl.tools at gmail dot com 2012-10-14 19:23:11 
UTC ---

(In reply to comment #7)

 Created attachment 28445 [details]

 Prototype patch that introduces VALGRIND_MAKE_MEM_DEFINED

 

 Attached prototype patch builds on HJ's patch. The patch detects valgrind in

 the same way as in gcc directory (actually, it just copies relevant bits) and

 changes:

 

 +  memset (to.text + to.len + 1, 0, 16);

 

 to

 

 +  VALGRIND_DISCARD (VALGRIND_MAKE_MEM_DEFINED (to.text + to.len + 1, 
 16));

 

 (BTW: Probably, we should align end of buffer to 16 byte boundary instead of

 hardcoding 16.)

 



libcpp will read in advance beyond the end of buffer in

some cases, even without SSE optimization.


[Bug other/54691] [4.8 Regression] --enable-checking=valgrind doesn't build

2012-10-12 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|UNCONFIRMED |NEW

   Last reconfirmed||2012-10-12

 CC||hjl.tools at gmail dot com

 Ever Confirmed|0   |1



--- Comment #3 from H.J. Lu hjl.tools at gmail dot com 2012-10-12 14:08:08 
UTC ---

PIC detection failed with valgrind:



configure:8446:

/export/build/gnu/gcc-lto-valgrind/build-x86_64-linux/./gcc/xgcc

-B/export/build/gnu/gcc-lto-valgrind/build-x86_64-linux/./gcc/

-B/usr/local/x86_64-unknown-linux-gnu/bin/

-B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem

/usr/local/x86_64-unknown-linux-gnu/include -isystem

/usr/local/x86_64-unknown-linux-gnu/sys-include  -m32 -c -g -O2 -pthread  -fPIC

-DPIC -DPIC conftest.c 5

==15652== Invalid read of size 8

==15652==at 0xEF7C94: search_line_sse42(unsigned char const*, unsigned char

const*) (lex.c:464)

==15652==by 0xEF7F48: _cpp_clean_line (lex.c:742)


[Bug other/54691] [4.8 Regression] --enable-checking=valgrind doesn't build

2012-10-12 Thread hjl.tools at gmail dot com


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



--- Comment #4 from H.J. Lu hjl.tools at gmail dot com 2012-10-12 16:47:58 
UTC ---

Please try git hjl/valgrind branch:



http://gcc.gnu.org/git/?p=gcc.git;a=shortlog;h=refs/heads/hjl/valgrind


[Bug other/54691] [4.8 Regression] --enable-checking=valgrind doesn't build

2012-10-12 Thread ubizjak at gmail dot com


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



--- Comment #5 from Uros Bizjak ubizjak at gmail dot com 2012-10-12 17:06:25 
UTC ---

Maybe VALGRIND_DISCARD would come handy here?


[Bug other/54691] [4.8 Regression] --enable-checking=valgrind doesn't build

2012-10-12 Thread markus at trippelsdorf dot de


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



--- Comment #6 from Markus Trippelsdorf markus at trippelsdorf dot de 
2012-10-12 18:46:14 UTC ---

(In reply to comment #4)

 Please try git hjl/valgrind branch:

 

 http://gcc.gnu.org/git/?p=gcc.git;a=shortlog;h=refs/heads/hjl/valgrind



It builds fine now. Thank you.


[Bug other/54691] [4.8 Regression] --enable-checking=valgrind doesn't build

2012-10-11 Thread hjl.tools at gmail dot com


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



--- Comment #2 from H.J. Lu hjl.tools at gmail dot com 2012-10-11 18:22:07 
UTC ---

Please try ld.bfd from binutils trunk or 2.23.


[Bug other/54691] [4.8 Regression] --enable-checking=valgrind doesn't build

2012-09-24 Thread zsojka at seznam dot cz


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



--- Comment #1 from Zdenek Sojka zsojka at seznam dot cz 2012-09-24 18:44:51 
UTC ---

At x86_64-unknown-linux-gnu, the build fails at a different place:





...

libtool: link:

/home/smatz/build-191654-lto-checking-valgrind-disable-bootstrap-disable-graphite/./gcc/xgcc

-B/home/smatz/build-191654-lto-checking-valgrind-disable-bootstrap-disable-graphite/./gcc/

-B/mnt/svn/gcc-trunk/binary-191654-lto-checking-valgrind-disable-bootstrap-disable-graphite/x86_64-unknown-linux-gnu/bin/

-B/mnt/svn/gcc-trunk/binary-191654-lto-checking-valgrind-disable-bootstrap-disable-graphite/x86_64-unknown-linux-gnu/lib/

-isystem

/mnt/svn/gcc-trunk/binary-191654-lto-checking-valgrind-disable-bootstrap-disable-graphite/x86_64-unknown-linux-gnu/include

-isystem

/mnt/svn/gcc-trunk/binary-191654-lto-checking-valgrind-disable-bootstrap-disable-graphite/x86_64-unknown-linux-gnu/sys-include

   -shared  math/.libs/acoshq.o math/.libs/fmodq.o math/.libs/acosq.o

math/.libs/frexpq.o math/.libs/rem_pio2q.o math/.libs/asinhq.o

math/.libs/hypotq.o math/.libs/remainderq.o math/.libs/asinq.o

math/.libs/rintq.o math/.libs/atan2q.o math/.libs/isinfq.o math/.libs/roundq.o

math/.libs/atanhq.o math/.libs/isnanq.o math/.libs/scalblnq.o

math/.libs/atanq.o math/.libs/j0q.o math/.libs/scalbnq.o math/.libs/cbrtq.o

math/.libs/j1q.o math/.libs/signbitq.o math/.libs/ceilq.o math/.libs/jnq.o

math/.libs/sincos_table.o math/.libs/complex.o math/.libs/ldexpq.o

math/.libs/sincosq.o math/.libs/copysignq.o math/.libs/lgammaq.o

math/.libs/sincosq_kernel.o math/.libs/coshq.o math/.libs/llroundq.o

math/.libs/sinhq.o math/.libs/cosq.o math/.libs/log10q.o math/.libs/sinq.o

math/.libs/cosq_kernel.o math/.libs/log1pq.o math/.libs/sinq_kernel.o

math/.libs/erfq.o math/.libs/logq.o math/.libs/sqrtq.o math/.libs/expm1q.o

math/.libs/lroundq.o math/.libs/tanhq.o math/.libs/expq.o math/.libs/modfq.o

math/.libs/tanq.o math/.libs/fabsq.o math/.libs/nanq.o math/.libs/tgammaq.o

math/.libs/finiteq.o math/.libs/nextafterq.o math/.libs/truncq.o

math/.libs/floorq.o math/.libs/powq.o math/.libs/fmaq.o math/.libs/cacoshq.o

math/.libs/cacosq.o math/.libs/casinhq.o math/.libs/casinq.o

math/.libs/catanhq.o math/.libs/catanq.o math/.libs/cimagq.o math/.libs/conjq.o

math/.libs/cprojq.o math/.libs/crealq.o math/.libs/fdimq.o math/.libs/fmaxq.o

math/.libs/fminq.o math/.libs/ilogbq.o math/.libs/llrintq.o math/.libs/log2q.o

math/.libs/lrintq.o math/.libs/nearbyintq.o math/.libs/remquoq.o

printf/.libs/addmul_1.o printf/.libs/add_n.o printf/.libs/cmp.o

printf/.libs/divrem.o printf/.libs/flt1282mpn.o printf/.libs/fpioconst.o

printf/.libs/lshift.o printf/.libs/mul_1.o printf/.libs/mul_n.o

printf/.libs/mul.o printf/.libs/printf_fphex.o printf/.libs/printf_fp.o

printf/.libs/quadmath-printf.o printf/.libs/rshift.o printf/.libs/submul_1.o

printf/.libs/sub_n.o strtod/.libs/strtoflt128.o strtod/.libs/mpn2flt128.o

strtod/.libs/tens_in_limb.o-lm 

-Wl,--version-script=/mnt/svn/gcc-trunk/libquadmath/quadmath.map   -Wl,-soname

-Wl,libquadmath.so.0 -o .libs/libquadmath.so.0.0.0

/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/../../../../x86_64-pc-linux-gnu/bin/ld:

math/.libs/fmodq.o: relocation R_X86_64_32S against `.rodata' can not be used

when making a shared object; recompile with -fPIC

math/.libs/fmodq.o: could not read symbols: Bad value

collect2: error: ld returned 1 exit status

make[3]: *** [libquadmath.la] Error 1

make[3]: Leaving directory

`/home/smatz/build-191654-lto-checking-valgrind-disable-bootstrap-disable-graphite/x86_64-unknown-linux-gnu/libquadmath'

make[2]: *** [all] Error 2

make[2]: Leaving directory

`/home/smatz/build-191654-lto-checking-valgrind-disable-bootstrap-disable-graphite/x86_64-unknown-linux-gnu/libquadmath'

make[1]: *** [all-target-libquadmath] Error 2

make[1]: Leaving directory

`/home/smatz/build-191654-lto-checking-valgrind-disable-bootstrap-disable-graphite'

make: *** [all] Error 2