From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15827 invoked by alias); 14 Mar 2012 09:35:44 -0000 Received: (qmail 15716 invoked by uid 22791); 14 Mar 2012 09:35:43 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 14 Mar 2012 09:35:30 +0000 From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/52571] vectorizer changes alignment of common symbols Date: Wed, 14 Mar 2012 09:39:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-03/txt/msg01241.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52571 --- Comment #4 from rguenther at suse dot de 2012-03-14 09:35:12 UTC --- On Tue, 13 Mar 2012, ian at airs dot com wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52571 > > --- Comment #3 from Ian Lance Taylor 2012-03-13 15:48:36 UTC --- > I agree: if the symbol is always common, the linker should use the largest > alignment. But the symbol need not always be common. Consider one file with > "unsigned long int *p;" and another file with "unsigned long int *p = &i;". > That is a valid use of common symbols. But now gcc might mark the common > symbol as having an alignment of 16, while leaving the definition with an > alignment of 8. The rules of common symbol linking mean that the definition > will override the common symbol. But the definition might have an alignment of > 8, and it might not be possible for the linker to fix that--and in any case, > the linker won't even try. > > In other words, common symbols are special. You can't assume that anything you > change about them will stick, because they might become, in effect, an > undefined symbol. I suspect that vect_can_force_dr_alignment_p should be > checking DECL_COMMON for exactly the reasons that it checks DECL_EXTERNAL. Ok, thanks for the clarification, I'll produce a patch. Richard.