Re: Weird optimization for tuples?

2017-02-12 Thread Jonathan Wakely
I've answered on gcc-help instead.

On 12 February 2017 at 00:55, David Guillen Fandos  wrote:
> Hello!
>
> I have the following function
> std::tuple getRawIdx(uint16_t tidx) {
>   return std::make_tuple(localidx.entries[tidx].indx_ptr,
> localidx.entries[tidx].indx_size);
> }
>
> Where s is a struct like
>
> typedef struct __attribute__((packed)) {
> uint32_t indx_ptr;
> uint8_t  indx_size;
> } _i_idx_entry ;
>
> The error I get is:
>
>  cannot bind packed field
> ‘((DBIndex*)this)->DBIndex::localidx.DBIndex::_i_idx::entries[((int)tidx)].DBIndex::_i_idx_entry::indx_ptr’
> to ‘unsigned int&’
>
> If extend the tuple to include a 3rd field and I return some other thing
> it just works:
>
> return std::make_tuple(localidx.entries[tidx].indx_ptr,
>localidx.entries[tidx].indx_size,
>tidx, prefb);
>
> I think gcc is trying to do some smart optimization or something and
> packed does not work because of tuple alignments not being packed.
>
> Any ideas?
> Thanks!
> David
>


gcc-7-20170212 is now available

2017-02-12 Thread gccadmin
Snapshot gcc-7-20170212 is now available on
  ftp://gcc.gnu.org/pub/gcc/snapshots/7-20170212/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 7 SVN branch
with the following options: svn://gcc.gnu.org/svn/gcc/trunk revision 245378

You'll find:

 gcc-7-20170212.tar.bz2   Complete GCC

  MD5=0074d94da90aa234fb0c7b689416d665
  SHA1=242003fb9b6c29658effb7bcd62cf65decbd7082

Diffs from 7-20170205 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-7
link is updated and a message is sent to the gcc list.  Please do not use
a snapshot before it has been announced that way.


[BUILDROBOT] arm-netbsdelf: "cc1: internal compiler error: Segmentation fault" during -fself-test triggered from forcibly_ggc_collect()

2017-02-12 Thread Jan-Benedict Glaw
Hi!

When building a cross-gcc using config_list.mk using r245361 (as both,
a freshly built `build' compiler and as sources for the
cross-compiler), my build robot fails (see
http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=696565).
Seems this is only triggered for arm-netbsdelf, it's running fine for
many/all? other targets in config_list.mk .

[...]
/home/jbglaw/build-configlist_mk/arm-netbsdelf/build-gcc/mk/arm-netbsdelf/./gcc/xgcc
 
-B/home/jbglaw/build-configlist_mk/arm-netbsdelf/build-gcc/mk/arm-netbsdelf/./gcc/
 -nostdinc -x c /dev/null -S -o /dev/null 
-fself-test=/home/jbglaw/repos-configlist_mk/gcc/gcc/testsuite/selftests
cc1: internal compiler error: Segmentation fault
0xaf7fdf crash_signal
/home/jbglaw/repos-configlist_mk/gcc/gcc/toplev.c:333
0x6739b3 lookup_page_table_entry
/home/jbglaw/repos-configlist_mk/gcc/gcc/ggc-page.c:635
0x6739b3 ggc_set_mark(void const*)
/home/jbglaw/repos-configlist_mk/gcc/gcc/ggc-page.c:1532
0x571bff gt_ggc_mx_lang_tree_node(void*)
./gt-c-c-decl.h:49
0x57242a gt_ggc_mx_lang_tree_node(void*)
./gt-c-c-decl.h:401
0x572fae gt_ggc_mx_lang_tree_node(void*)
./gt-c-c-decl.h:382
0x571e61 gt_ggc_mx_lang_tree_node(void*)
./gt-c-c-decl.h:391
0x83ed15 ggc_mark_root_tab
/home/jbglaw/repos-configlist_mk/gcc/gcc/ggc-common.c:77
0x83ef70 ggc_mark_roots()
/home/jbglaw/repos-configlist_mk/gcc/gcc/ggc-common.c:94
0x674417 ggc_collect()
/home/jbglaw/repos-configlist_mk/gcc/gcc/ggc-page.c:2202
0x842dff selftest::forcibly_ggc_collect()
/home/jbglaw/repos-configlist_mk/gcc/gcc/ggc-tests.c:36
0x11d0491 selftest::run_tests()
/home/jbglaw/repos-configlist_mk/gcc/gcc/selftest-run-tests.c:103
0xaf9742 toplev::run_self_tests()
/home/jbglaw/repos-configlist_mk/gcc/gcc/toplev.c:2046
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
Makefile:1932: recipe for target 's-selftest' failed
make[2]: *** [s-selftest] Error 1
rm fsf-funding.pod gcov.pod gpl.pod cpp.pod gfdl.pod gfortran.pod gcc.pod 
gcov-tool.pod gccgo.pod
make[2]: Leaving directory 
'/home/jbglaw/build-configlist_mk/arm-netbsdelf/build-gcc/mk/arm-netbsdelf/gcc'
Makefile:4229: recipe for target 'all-gcc' failed
make[1]: *** [all-gcc] Error 2

Unfortunately, I don't know a good revision or when it started to
fail.

MfG, JBG

-- 
  Jan-Benedict Glaw  jbg...@lug-owl.de  +49-172-7608481
Signature of:  Alles sollte so einfach wie möglich gemacht sein.
the second  :  Aber nicht einfacher.  (Einstein)


signature.asc
Description: Digital signature