Re: [PATCH 1/4] Add mkoffload for Intel MIC

2015-09-29 Thread Bernd Schmidt
On 09/29/2015 12:29 PM, Richard Biener wrote: I agree that obstacks are better here. Efficiency shouldn't matter here. But we're in C++ now so can't we statically construct the array with sth like const char *new_argv[] = { "objcopy", ... }; ? Thus have the compiler figure out the number of a

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2015-09-29 Thread Richard Biener
On Mon, Sep 28, 2015 at 2:05 PM, Bernd Schmidt wrote: > On 09/28/2015 02:00 PM, Jakub Jelinek wrote: >> >> On Mon, Sep 28, 2015 at 01:27:32PM +0200, Bernd Schmidt wrote: I've removed obstack_ptr_grow for arrays with known sizes after this review: https://gcc.gnu.org/ml/gcc-patc

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2015-09-28 Thread Bernd Schmidt
On 09/28/2015 02:00 PM, Jakub Jelinek wrote: On Mon, Sep 28, 2015 at 01:27:32PM +0200, Bernd Schmidt wrote: I've removed obstack_ptr_grow for arrays with known sizes after this review: https://gcc.gnu.org/ml/gcc-patches/2014-10/msg02210.html That's unfortunate, I think that made the code less

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2015-09-28 Thread Jakub Jelinek
On Mon, Sep 28, 2015 at 01:27:32PM +0200, Bernd Schmidt wrote: > >I've removed obstack_ptr_grow for arrays with known sizes after this review: > >https://gcc.gnu.org/ml/gcc-patches/2014-10/msg02210.html > > That's unfortunate, I think that made the code less future-proof. IMO we > should revert to

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2015-09-28 Thread Bernd Schmidt
On 09/28/2015 01:25 PM, Ilya Verbin wrote: On Mon, Sep 28, 2015 at 12:09:19 +0200, Bernd Schmidt wrote: On 09/28/2015 12:03 PM, Bernd Schmidt wrote: On 09/28/2015 10:26 AM, Thomas Schwinge wrote: - objcopy_argv[8] = NULL; + objcopy_argv[objcopy_argc++] = NULL; + gcc_checking_assert (objcopy

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2015-09-28 Thread Ilya Verbin
On Mon, Sep 28, 2015 at 12:09:19 +0200, Bernd Schmidt wrote: > On 09/28/2015 12:03 PM, Bernd Schmidt wrote: > >On 09/28/2015 10:26 AM, Thomas Schwinge wrote: > >>- objcopy_argv[8] = NULL; > >>+ objcopy_argv[objcopy_argc++] = NULL; > >>+ gcc_checking_assert (objcopy_argc <= OBJCOPY_ARGC_MAX); > >

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2015-09-28 Thread Bernd Schmidt
On 09/28/2015 12:03 PM, Bernd Schmidt wrote: On 09/28/2015 10:26 AM, Thomas Schwinge wrote: - objcopy_argv[8] = NULL; + objcopy_argv[objcopy_argc++] = NULL; + gcc_checking_assert (objcopy_argc <= OBJCOPY_ARGC_MAX); On its own this is not an improvement - you're trading a compile time error

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2015-09-28 Thread Bernd Schmidt
On 09/28/2015 10:26 AM, Thomas Schwinge wrote: - objcopy_argv[8] = NULL; + objcopy_argv[objcopy_argc++] = NULL; + gcc_checking_assert (objcopy_argc <= OBJCOPY_ARGC_MAX); On its own this is not an improvement - you're trading a compile time error for a runtime error. So, what is the other ch

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2015-09-28 Thread Thomas Schwinge
Hi! On Wed, 22 Oct 2014 22:57:01 +0400, Ilya Verbin wrote: > On 22 Oct 09:57, Jakub Jelinek wrote: > > On Wed, Oct 22, 2014 at 02:30:44AM +0400, Ilya Verbin wrote: > > > + obstack_init (&argv_obstack); > > > + obstack_ptr_grow (&argv_obstack, "objcopy"); > > > + obstack_ptr_grow (&argv_obstack

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2015-02-18 Thread Jakub Jelinek
On Wed, Feb 18, 2015 at 12:48:21PM +0100, Thomas Schwinge wrote: > > --- /dev/null > > +++ b/gcc/config/i386/t-intelmic > > @@ -0,0 +1,9 @@ > > +mkoffload.o: $(srcdir)/config/i386/intelmic-mkoffload.c | insn-modes.h > > + $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ > > +

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2015-02-18 Thread Ilya Verbin
On Wed, Feb 18, 2015 at 12:48:21 +0100, Thomas Schwinge wrote: > What is the rationale for the insn-modes.h order-only prerequisites for > mkoffload.o? Is this simply to get past the build issue which, for > example, Jakub also reported for the nvptx mkoffload, >

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2015-02-18 Thread Thomas Schwinge
Hi! On Wed, 22 Oct 2014 22:57:01 +0400, Ilya Verbin wrote: > --- /dev/null > +++ b/gcc/config/i386/intelmic-mkoffload.c > +[...] > +#include "config.h" > +#include > +#include "system.h" > +#include "coretypes.h" > +#include "obstack.h" > +#include "intl.h" > +#include "diagnostic.h" > +#include

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2015-01-08 Thread Thomas Schwinge
Hi! On Thu, 8 Jan 2015 07:02:19 -0800, "H.J. Lu" wrote: > On Thu, Jan 8, 2015 at 6:59 AM, Thomas Schwinge > wrote: > > commit c049b358f961f72d0c0cf61a707e9a5855b12b28 > > Author: tschwinge > > Date: Thu Jan 8 14:58:45 2015 + > > > > intelmic-mkoffload: Deal with linker defaulting to

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2015-01-08 Thread H.J. Lu
On Thu, Jan 8, 2015 at 6:59 AM, Thomas Schwinge wrote: > Hi! > > On Mon, 22 Dec 2014 12:28:20 +0100, Jakub Jelinek wrote: >> On Mon, Dec 22, 2014 at 12:25:32PM +0100, Thomas Schwinge wrote: >> > On Wed, 22 Oct 2014 22:57:01 +0400, Ilya Verbin wrote: >> > > --- /dev/null >> > > +++ b/gcc/config/i

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2015-01-08 Thread Thomas Schwinge
Hi! On Mon, 22 Dec 2014 12:28:20 +0100, Jakub Jelinek wrote: > On Mon, Dec 22, 2014 at 12:25:32PM +0100, Thomas Schwinge wrote: > > On Wed, 22 Oct 2014 22:57:01 +0400, Ilya Verbin wrote: > > > --- /dev/null > > > +++ b/gcc/config/i386/intelmic-mkoffload.c > > > @@ -0,0 +1,541 @@ > > > +/* Offloa

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2014-12-22 Thread Jakub Jelinek
On Mon, Dec 22, 2014 at 12:25:32PM +0100, Thomas Schwinge wrote: > Hi! > > On Wed, 22 Oct 2014 22:57:01 +0400, Ilya Verbin wrote: > > --- /dev/null > > +++ b/gcc/config/i386/intelmic-mkoffload.c > > @@ -0,0 +1,541 @@ > > +/* Offload image generation tool for Intel MIC devices. > > > +/* Shows if

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2014-12-22 Thread Thomas Schwinge
Hi! On Wed, 22 Oct 2014 22:57:01 +0400, Ilya Verbin wrote: > --- /dev/null > +++ b/gcc/config/i386/intelmic-mkoffload.c > @@ -0,0 +1,541 @@ > +/* Offload image generation tool for Intel MIC devices. > +/* Shows if we should compile binaries for i386 instead of x86-64. */ > +bool target_ilp32 =

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2014-11-06 Thread Jakub Jelinek
On Wed, Oct 22, 2014 at 10:57:01PM +0400, Ilya Verbin wrote: > gcc/ > * config.gcc (*-intelmic-* | *-intelmicemul-*): Add i386/t-intelmic to > tmake_file. > (i[34567]86-*-* | x86_64-*-*): Build mkoffload$(exeext) with the > accelerator compiler. > * config/i386/intelmi

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2014-10-22 Thread Ilya Verbin
On 22 Oct 09:57, Jakub Jelinek wrote: > On Wed, Oct 22, 2014 at 02:30:44AM +0400, Ilya Verbin wrote: > > This mkoffload is expected to be built only with the offload compiler, > > which is expected to be configured with > > '--enable-as-accelerator-for=... --host=x86_64-*-linux-gnu > > --target=x86

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2014-10-22 Thread Jakub Jelinek
On Tue, Oct 21, 2014 at 09:16:02PM +0400, Ilya Verbin wrote: > --- a/gcc/Makefile.in > +++ b/gcc/Makefile.in > @@ -3895,3 +3895,14 @@ DEPFILES = \ >$(foreach obj,$(ALL_HOST_OBJS),\ > $(dir $(obj))$(DEPDIR)/$(patsubst %.o,%.Po,$(notdir $(obj > -include $(DEPFILES) > + > + > +mkoffload.

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2014-10-22 Thread Jakub Jelinek
On Wed, Oct 22, 2014 at 02:30:44AM +0400, Ilya Verbin wrote: > > I don't see anything restricting this program to being built for GNU > > *hosts*. Thus, it needs to be portable (to different hosts; obviously > > it's target-architecture-specific) rather than relying on glibc > > interfaces. (Prov

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2014-10-21 Thread Ilya Verbin
2014-10-22 1:55 GMT+04:00 Joseph S. Myers : > On Tue, 21 Oct 2014, Ilya Verbin wrote: > >> +#include >> +#include "config.h" >> +#include "system.h" > > You should never include system headers before config.h because config.h > may define feature test macros such as _FILE_OFFSET_BITS=64 that are >

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2014-10-21 Thread Joseph S. Myers
On Tue, 21 Oct 2014, Ilya Verbin wrote: > +#include > +#include "config.h" > +#include "system.h" You should never include system headers before config.h because config.h may define feature test macros such as _FILE_OFFSET_BITS=64 that are ineffective if defined after any system header is incl