git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: git@vger.kernel.org, "Junio C Hamano" <gitster@pobox.com>,
	"Torsten Bögershausen" <tboegi@web.de>,
	"Renato Botelho" <garga@freebsd.org>
Subject: Re: [PATCH 1/2] git-compat-util: st_add4: work around gcc 4.2.x compiler crash
Date: Mon, 21 Mar 2016 00:43:35 -0400	[thread overview]
Message-ID: <20160321044335.GA20519@sigill.intra.peff.net> (raw)
In-Reply-To: <1458534958-6956-2-git-send-email-sunshine@sunshineco.com>

On Mon, Mar 21, 2016 at 12:35:57AM -0400, Eric Sunshine wrote:

> Although changes by 5b442c4 (tree-diff: catch integer overflow in
> combine_diff_path allocation, 2016-02-19) are perfectly valid, they
> unfortunately trigger an internal compiler error in gcc 4.2.x:
> 
>     combine-diff.c: In function 'diff_tree_combined':
>     combine-diff.c:1391: internal compiler error: Segmentation fault: 11
> 
> Experimentation reveals that changing st_add4()'s argument evaluation
> order is sufficient to sidestep this problem.
> 
> Although st_add3() does not trigger the compiler bug, for style
> consistency, change its argument evaluation order to match.
> 
> Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
> ---
>  git-compat-util.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Thanks for digging into this, the result is a really pleasant solution.
I think it's worth doing.

-Peff

  reply	other threads:[~2016-03-21  4:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-21  4:35 [PATCH 0/2] work around gcc 4.2.x compiler crash Eric Sunshine
2016-03-21  4:35 ` [PATCH 1/2] git-compat-util: st_add4: " Eric Sunshine
2016-03-21  4:43   ` Jeff King [this message]
2016-03-21  4:56   ` Christian Couder
2016-03-21  5:38     ` Eric Sunshine
2016-03-21 17:46   ` Torsten Bögershausen
2016-03-21  4:35 ` [PATCH 2/2] Revert "config.mak.uname: use clang for Mac OS X 10.6" Eric Sunshine

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=20160321044335.GA20519@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=garga@freebsd.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sunshine@sunshineco.com \
    --cc=tboegi@web.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 NNTP newsgroup(s).