public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: Ilya Verbin <iverbin@gmail.com>
Cc: Jan Hubicka <hubicka@ucw.cz>, gcc-patches@gcc.gnu.org,	rguenther@suse.de
Subject: Re: Silence merge warnings on artiical types
Date: Mon, 30 Mar 2015 17:16:00 -0000	[thread overview]
Message-ID: <20150330171646.GB14471@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <20150330171047.GB64930@msticlxl57.ims.intel.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);

  reply	other threads:[~2015-03-30 17:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-30  3:03 Jan Hubicka
2015-03-30  8:30 ` Richard Biener
2015-03-30  8:48   ` Jan Hubicka
2015-03-30 15:36 ` Ilya Verbin
2015-03-30 17:06   ` Jan Hubicka
2015-03-30 17:11     ` Ilya Verbin
2015-03-30 17:16       ` Jan Hubicka [this message]
2015-03-30 17:21     ` Jakub Jelinek
2015-03-30 17:23       ` Jan Hubicka
2015-03-30 17:53         ` Jason Merrill
2015-03-31  7:51           ` Silence merge warnings on artificial types Jan Hubicka
2015-03-31 13:26             ` Jason Merrill
2015-04-02 18:23             ` Ilya Verbin
2015-04-02 18:37               ` Jan Hubicka
2015-04-02 19:06               ` Jakub Jelinek
2015-04-03 13:36                 ` Jakub Jelinek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150330171646.GB14471@atrey.karlin.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iverbin@gmail.com \
    --cc=rguenther@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).