mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-11-24 11:04:03 +08:00
53bb714513
When writing the HOST_SIZE_T_PRINT_UNSIGNED incremental patch, my first bootstrap failed on i686-linux. That is because I've also had @@ -1344,8 +1344,10 @@ adjust_field_rtx_def (type_p t, options_ } subfields = create_field (subfields, t, - xasprintf (".fld[%lu].%s", - (unsigned long) aindex, + xasprintf (".fld[" + HOST_SIZE_T_PRINT_UNSIGNED + "].%s", + (fmt_size_t) aindex, subname)); subfields->opt = nodot; if (t == note_union_tp) hunk in gengtype.cc. While sprintf obviously can print in this case %llu with fmt_size_t being unsigned long long (that is another bug I'll fix incrementally), seems libiberty_vprintf_buffer_size can't deal with that, it ignores h, hh, l, ll and L modifiers and unconditionally, estimates 30 chars as upper bounds for integers (that is fine) and then uses (void) va_arg (ap, int); to skip over the argument regardless if it was %d, %ld, %lld, %hd, %hhd etc. Now, on x86_64 that happens to work fine probably for all of those, on ia32 for everything but %lld, because it then skips just one half of the long long argument; now as there is %s after it, it will try to compute strlen not from the pointer argument corresponding to %s, but from the most significant half of the previous long long argument. So, the following patch attempts not to completely ignore the modifiers, but figure out from them whether to va_arg an int (used for h and hh as well), or long, or long long, or size_t, or ptrdiff_t - added support for z and t there, plus for Windows I64. And also %Lf etc. for long double. 2024-02-12 Jakub Jelinek <jakub@redhat.com> * vprintf-support.c (libiberty_vprintf_buffer_size): Handle properly l, ll, z, t or on _WIN32 I64 modifiers for diouxX and L modifier for fFgGeE. |
||
---|---|---|
.github | ||
c++tools | ||
config | ||
contrib | ||
fixincludes | ||
gcc | ||
gnattools | ||
gotools | ||
include | ||
INSTALL | ||
libada | ||
libatomic | ||
libbacktrace | ||
libcc1 | ||
libcody | ||
libcpp | ||
libdecnumber | ||
libffi | ||
libgcc | ||
libgfortran | ||
libgm2 | ||
libgo | ||
libgomp | ||
libgrust | ||
libiberty | ||
libitm | ||
libobjc | ||
libphobos | ||
libquadmath | ||
libsanitizer | ||
libssp | ||
libstdc++-v3 | ||
libvtv | ||
lto-plugin | ||
maintainer-scripts | ||
zlib | ||
.dir-locals.el | ||
.gitattributes | ||
.gitignore | ||
ABOUT-NLS | ||
ar-lib | ||
ChangeLog | ||
ChangeLog.jit | ||
ChangeLog.tree-ssa | ||
compile | ||
config-ml.in | ||
config.guess | ||
config.rpath | ||
config.sub | ||
configure | ||
configure.ac | ||
COPYING | ||
COPYING3 | ||
COPYING3.LIB | ||
COPYING.LIB | ||
COPYING.RUNTIME | ||
depcomp | ||
install-sh | ||
libtool-ldflags | ||
libtool.m4 | ||
lt~obsolete.m4 | ||
ltgcc.m4 | ||
ltmain.sh | ||
ltoptions.m4 | ||
ltsugar.m4 | ||
ltversion.m4 | ||
MAINTAINERS | ||
Makefile.def | ||
Makefile.in | ||
Makefile.tpl | ||
missing | ||
mkdep | ||
mkinstalldirs | ||
move-if-change | ||
multilib.am | ||
README | ||
SECURITY.txt | ||
symlink-tree | ||
test-driver | ||
ylwrap |
This directory contains the GNU Compiler Collection (GCC). The GNU Compiler Collection is free software. See the files whose names start with COPYING for copying permission. The manuals, and some of the runtime libraries, are under different terms; see the individual source files for details. The directory INSTALL contains copies of the installation information as HTML and plain text. The source of this information is gcc/doc/install.texi. The installation information includes details of what is included in the GCC sources and what files GCC installs. See the file gcc/doc/gcc.texi (together with other files that it includes) for usage and porting information. An online readable version of the manual is in the files gcc/doc/gcc.info*. See http://gcc.gnu.org/bugs/ for how to report bugs usefully. Copyright years on GCC source files may be listed using range notation, e.g., 1987-2012, indicating that every year in the range, inclusive, is a copyrightable year that could otherwise be listed individually.