From patchwork Sun Oct 14 21:51:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 10675 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id D4DCE446E27 for ; Mon, 15 Oct 2018 00:51:16 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 34B97689D85; Mon, 15 Oct 2018 00:50:58 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-it1-f181.google.com (mail-it1-f181.google.com [209.85.166.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8783A689A23 for ; Mon, 15 Oct 2018 00:50:51 +0300 (EEST) Received: by mail-it1-f181.google.com with SMTP id h6-v6so26029180ith.0 for ; Sun, 14 Oct 2018 14:51:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=G0EivFxLOWmxpl/0mFl7nByZjfWt0+UXQgjx0+G31M4=; b=OV31hvipfHMY111kbMN51Rb8Vhyo7Vs/zxme/yy+Uq8dGp4IgPu9xfQFacZZn2sBz5 EoHKKT8GCNx/bmABUsN4oT7vTKuDzI7WD6J4qTejrxNHartzDIdxxLEch++PrN1PJFza 7bbyE0tbDXLd5bvSsXrTFP7baiNmZRkmaUsafBwROhPsLOFPXla/eIyDfiRSGuZJEGoS IMEABR7QLmAxhUrjGBSkD5Gu/Gm6Gw3UiE0pCT6n5wECZZ5DsP4pkJThSAdvk5+2cGf+ Hfu+IMcWYuXNwxNtNZub6DoltvCrr3onu5Q2hs/dA9wyKB3uDL0wllPVFpjJgIugjA5Z r48w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=G0EivFxLOWmxpl/0mFl7nByZjfWt0+UXQgjx0+G31M4=; b=qyyVCeKDWotoPEbJOl/sxr1+zHkcUebVjqZfbYaH4W6ZAmaGzo4TfT/D6j63dbX+Nx KAs9KbJ5ei9KnRbAZp9gSZ7yCWvTIZbQAd17czkOfFcbQ95X5/33H7aUc+N8FFq5O6uL b6v3kotLz57hV7PaiwgYbALoIxBrq2awINsWyShUR0gcN1Reu04mT3uyVx0x4B8PiGHe j7AFHXKlDu9faWOC5eBWw53zyUppJmnRy/GfdZZmRNUgjk36Y68gmuQ8iJIQIBXj0OSg m5FLP+ukncHCAjw3pAa8otsoueC9ct941wCASOuzqRKGifbhlksAVSSZtpAbK45gwbXX rL4A== X-Gm-Message-State: ABuFfog2fEenvW5FpcRX6zLhK5iMFQMaVVXGmx7jCjKbBPtuMjNqrrC2 hgmMOveRWRUzLgcW3fm3Uj3xRQGdNpFYzCu96Z9JEQ== X-Google-Smtp-Source: ACcGV61x9ylDO7edwwodWNk0OYnWTYgrqBEd7BDmuGv5aQGxVAsF9Sd5gylfkr0vrVM8xJse+/twH6SDo95h81Nx4TE= X-Received: by 2002:a24:d147:: with SMTP id w68-v6mr11165695itg.149.1539553874029; Sun, 14 Oct 2018 14:51:14 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:c489:0:0:0:0:0 with HTTP; Sun, 14 Oct 2018 14:51:13 -0700 (PDT) In-Reply-To: References: From: Carl Eugen Hoyos Date: Sun, 14 Oct 2018 23:51:13 +0200 Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH]lavc/sinewin: Do not declare tables as const X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 2018-10-14 22:30 GMT+02:00, Hendrik Leppkes : > On Sun, Oct 14, 2018 at 10:18 PM Carl Eugen Hoyos > wrote: >> >> Attached patch is supposed to fix ticket #7491, I currently >> don't have gcc 8 to test myself. > > Only the 120 and 960 tables are affected by this bug because > they are not being created by the hardcoded tables logic, yet > this patch changes the const attribute for all tables, defeating > one purpose of the hardcoded tables. > Can we adjust this to only affect the two tables that need it Did that in attached patch, please comment. > or remove hardcoded tables for sinewin entirely, instead of leaving > them half-baked, or add 120 and 960 to hardcoded tables generation? Carl Eugen From 55fc231778360c921827915e6aa8a2b1a592dfdd Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Sun, 14 Oct 2018 23:48:23 +0200 Subject: [PATCH] lavc/sinewin: Do not declare AAC 120/960 tables as const. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ff_sine_window_init() is writing to these tables causing a crash if compiled with gcc 8 and lto. Analyzed by Martin Liška in: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85132 Fixes ticket #7491. --- libavcodec/sinewin.h | 7 +++++-- libavcodec/sinewin_tablegen.h | 4 ++-- libavcodec/sinewin_tablegen_template.c | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/libavcodec/sinewin.h b/libavcodec/sinewin.h index 6b97a71..329e9bb 100644 --- a/libavcodec/sinewin.h +++ b/libavcodec/sinewin.h @@ -38,6 +38,9 @@ #define SINETABLE(size) \ SINETABLE_CONST DECLARE_ALIGNED(32, INTFLOAT, AAC_RENAME(ff_sine_##size))[size] +#define SINETABLE120960(size) \ + DECLARE_ALIGNED(32, INTFLOAT, AAC_RENAME(ff_sine_##size))[size] + /** * Generate a sine window. * @param window pointer to half window @@ -52,11 +55,11 @@ void AAC_RENAME(ff_init_ff_sine_windows)(int index); extern SINETABLE( 32); extern SINETABLE( 64); -extern SINETABLE( 120); +extern SINETABLE120960(120); extern SINETABLE( 128); extern SINETABLE( 256); extern SINETABLE( 512); -extern SINETABLE( 960); +extern SINETABLE120960(960); extern SINETABLE(1024); extern SINETABLE(2048); extern SINETABLE(4096); diff --git a/libavcodec/sinewin_tablegen.h b/libavcodec/sinewin_tablegen.h index 0fa3561..dc52234 100644 --- a/libavcodec/sinewin_tablegen.h +++ b/libavcodec/sinewin_tablegen.h @@ -32,8 +32,8 @@ #include "libavutil/common.h" #if !USE_FIXED -SINETABLE( 120); -SINETABLE( 960); +SINETABLE120960(120); +SINETABLE120960(960); #endif #if !CONFIG_HARDCODED_TABLES SINETABLE( 32); diff --git a/libavcodec/sinewin_tablegen_template.c b/libavcodec/sinewin_tablegen_template.c index 43ce1ba..b8eb407 100644 --- a/libavcodec/sinewin_tablegen_template.c +++ b/libavcodec/sinewin_tablegen_template.c @@ -33,6 +33,8 @@ #define SINETABLE_CONST #define SINETABLE(size) \ INTFLOAT AAC_RENAME(ff_sine_##size)[size] +#define SINETABLE120960(size) \ + INTFLOAT AAC_RENAME(ff_sine_##size)[size] #define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0])) #include "sinewin_tablegen.h" #include "tableprint.h" -- 1.7.10.4