This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFR: Using XNEW.../XCNEW... allocations.


For me, it caused bootstrapping to fail like this:

/Volumes/HD/ltmp/ssen/gcc-build/./prev-gcc/xgcc -B/Volumes/HD/ltmp/ ssen/gcc-build/./prev-gcc/ -B/usr/local/i386-apple-darwin8.4.2/bin/ - c -O2 -g -fomit-frame-pointer -DIN_GCC -W -Wall -Wwrite-strings - Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno- variadic-macros -Wno-overlength-strings -Wold-style-definition - Wmissing-format-attribute -Werror -fno-common -DHAVE_CONFIG_H -I. - I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include - I./../intl -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../ libdecnumber -I../libdecnumber ../../gcc/gcc/mode-switching.c -o mode-switching.o
cc1: warnings being treated as errors
../../gcc/gcc/mode-switching.c: In function 'optimize_mode_switching':
../../gcc/gcc/mode-switching.c:409: warning: unused variable 'entry_exit_extra'
make[3]: *** [mode-switching.o] Error 1
make[2]: *** [all-stage2-gcc] Error 2
make[1]: *** [stage2-bubble] Error 2



- = xcalloc (last_basic_block + entry_exit_extra, sizeof **bb_info); + = XCNEWVEC (struct bb_info, last_basic_block);


Doesn't this also change the semantics, since the allocation size is smaller?


Shantonu

On Jan 31, 2006, at 2:53 PM, Andrew Pinski wrote:


On Jan 31, 2006, at 7:20 AM, Marcin Dalecki wrote:


The attached patch is making a lot of places use the libiberty type-safe
memory allocation wrapper XNEW... macro family. This is making the code a bit less terse
and more type safe. Everything inside this patch has been automatically verifyed.


OK to apply to trunk?

This causes a bootstrap failure now that gcc.c does not have -Wno-error.

The fix is:
[dandelion:local/gcc/gcc] pinskia% svn diff gcc.c
Index: gcc.c
===================================================================
--- gcc.c       (revision 110452)
+++ gcc.c       (working copy)
@@ -6481,7 +6481,7 @@ main (int argc, char **argv)

/* Record which files were specified explicitly as link input. */

-  explicit_link_files = XCNEWVEC (bool, n_infiles);
+  explicit_link_files = XCNEWVEC (char, n_infiles);

   if (combine_flag)
     combine_inputs = true;


I am bootstrapping this fix right now.


Next time please bootstrap and test your fix.

-- Pinski


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]