This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Silence merge warnings on artiical types
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Ilya Verbin <iverbin at gmail dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, gcc-patches at gcc dot gnu dot org, rguenther at suse dot de
- Date: Mon, 30 Mar 2015 19:16:46 +0200
- Subject: Re: Silence merge warnings on artiical types
- Authentication-results: sourceware.org; auth=none
- References: <20150330030257 dot GA71352 at kam dot mff dot cuni dot cz> <20150330153641 dot GA64930 at msticlxl57 dot ims dot intel dot com> <20150330170639 dot GD93920 at kam dot mff dot cuni dot cz> <20150330171047 dot GB64930 at msticlxl57 dot ims dot intel dot com>
> On Mon, Mar 30, 2015 at 19:06:39 +0200, Jan Hubicka wrote:
> > > On Mon, Mar 30, 2015 at 05:02:57 +0200, Jan Hubicka wrote:
> > > > * lto-symtab.c (lto_symtab_merge_decls_2): Silence warnings on
> > > > artificial decls.
> > >
> > > Shouldn't this patch fix libgomp.c++/target-3.C in an offloading-enabled
> > > configuration? It still fails...
> > >
> > > libgomp/testsuite/libgomp.c++/../libgomp.c/target-2.c:27:13: warning: type 'struct .omp_data_s.7' violates one definition rule [-Wodr]
> > > #pragma omp parallel for reduction(+:s)
> > > ^
> > > #pragma omp parallel for reduction(+:s)
> > > ^
> > > double b[3 * x], c[3 * x], d[3 * x], e[3 * x];
> > > ^
> > > double b[3 * x], c[3 * x], d[3 * x], e[3 * x];
> > > ^
> >
> > No, that is an different warning. Why those types are different? Is this a full warning output?
>
> Here is full output:
>
> spawn -ignore SIGHUP /gcc_build_host/gcc/xgcc -B/gcc_build_host/gcc/ /gcc/libgomp/testsuite/libgomp.c++/target-3.C -B/gcc_build_host/x86_64-pc-linux-gnu/./libgomp/ -B/gcc_build_host/x86_64-pc-linux-gnu/./libgomp/.libs -I/gcc_build_host/x86_64-pc-linux-gnu/./libgomp -I/gcc/libgomp/testsuite/../../include -I/gcc/libgomp/testsuite/.. -fmessage-length=0 -fno-diagnostics-show-caret -fdiagnostics-color=never -B/gcc_install/usr/local//libexec/gcc/x86_64-pc-linux-gnu/5.0.0 -B/gcc_install/usr/local//gcc -B/gcc_install/usr/local//bin -fopenmp -nostdinc++ -I/gcc_build_host/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I/gcc_build_host/x86_64-pc-linux-gnu/libstdc++-v3/include -I/gcc/libstdc++-v3/libsupc++ -I/gcc/libstdc++-v3/include/backward -I/gcc/libstdc++-v3/testsuite/util -B/gcc_build_host/x86_64-pc-linux-gnu/./libgomp/../libstdc++-v3/src/.libs -L/gcc_build_host/x86_64-pc-linux-gnu/./libgomp/.libs -L/gcc_build_host/x86_64-pc-linux-gnu/./libgomp/../libstdc++-v3/src/.libs -lstdc++ -lm -o ./target-3.exe
> /gcc/libgomp/testsuite/libgomp.c++/../libgomp.c/target-2.c:27:13: warning: type 'struct .omp_data_s.7' violates one definition rule [-Wodr]
> #pragma omp parallel for reduction(+:s)
> ^
> /gcc/libgomp/testsuite/libgomp.c++/../libgomp.c/target-2.c:27:13: note: a different type is defined in another translation unit
> #pragma omp parallel for reduction(+:s)
> ^
> /gcc/libgomp/testsuite/libgomp.c++/../libgomp.c/target-2.c:22:17: note: the first difference of corresponding definitions is field 'b.0'
> double b[3 * x], c[3 * x], d[3 * x], e[3 * x];
> ^
> /gcc/libgomp/testsuite/libgomp.c++/../libgomp.c/target-2.c:22:17: note: a field of same name but different type is defined in another translation unit
> double b[3 * x], c[3 * x], d[3 * x], e[3 * x];
> ^
> lto1: note: array types have different bounds
I see, .omp_data_s is artificial type with variable array length. I suppose we
do not want to consider this one an ODR type like this?
Honza
Index: tree.c
===================================================================
--- tree.c (revision 221768)
+++ tree.c (working copy)
@@ -5139,6 +5140,7 @@
&& decl == TYPE_NAME (TREE_TYPE (decl))
&& !is_lang_specific (TREE_TYPE (decl))
&& AGGREGATE_TYPE_P (TREE_TYPE (decl))
+ && !DECL_ARTIFICIAL (decl)
&& !variably_modified_type_p (TREE_TYPE (decl), NULL_TREE)
&& !type_in_anonymous_namespace_p (TREE_TYPE (decl)))
return !DECL_ASSEMBLER_NAME_SET_P (decl);