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: [PATCH 1/4] Add mkoffload for Intel MIC


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_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 change this is
preparing for?

Ok, I now see the other patch. But I also see that other code in the same
file and in the nvptx mkoffload is using the obstack_ptr_grow method to
build argv arrays, I think that would be preferrable to this.

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 the obstack method especially if Thomas -v patch goes in.


Bernd


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