Index: src/wp-includes/class-wp-comment-query.php
===================================================================
--- src/wp-includes/class-wp-comment-query.php	(revision 37571)
+++ src/wp-includes/class-wp-comment-query.php	(working copy)
@@ -254,6 +254,7 @@
 	 *                                                   Default true.
 	 *     @type bool         $update_comment_post_cache Whether to prime the cache for comment posts.
 	 *                                                   Default false.
+	 *     @type bool         $suppress_filters          Whether to suppress filters. Default false.
 	 * }
 	 */
 	public function __construct( $query = '' ) {
@@ -301,6 +302,7 @@
 			'hierarchical' => false,
 			'update_comment_meta_cache' => true,
 			'update_comment_post_cache' => false,
+			'suppress_filters' => false,
 		);
 
 		if ( ! empty( $query ) ) {
@@ -482,7 +484,7 @@
 	 * @global wpdb $wpdb WordPress database abstraction object.
 	 */
 	protected function get_comment_ids() {
-		global $wpdb;
+		global $wp_query, $wpdb;
 
 		// Assemble clauses related to 'comment_approved'.
 		$approved_clauses = array();
@@ -650,6 +652,10 @@
 			}
 		}
 
+		if ( ! $this->query_vars['suppress_filters'] && is_comment_feed() ) {
+			$limits = apply_filters( 'comment_feed_limits', $limits, $wp_query );
+		}
+
 		if ( $this->query_vars['count'] ) {
 			$fields = 'COUNT(*)';
 		} else {
@@ -841,6 +847,10 @@
 			}
 		}
 
+		if ( ! $this->query_vars['suppress_filters'] && is_comment_feed() ) {
+			$join = apply_filters( 'comment_feed_join', $join, $wp_query );
+		}
+
 		if ( ! empty( $this->query_vars['date_query'] ) && is_array( $this->query_vars['date_query'] ) ) {
 			$this->date_query = new WP_Date_Query( $this->query_vars['date_query'], 'comment_date' );
 			$this->sql_clauses['where']['date_query'] = preg_replace( '/^\s*AND\s*/', '', $this->date_query->get_sql() );
@@ -868,14 +878,26 @@
 
 		$this->filtered_where_clause = $where;
 
+		if ( ! $this->query_vars['suppress_filters'] && is_comment_feed() ) {
+			$where = apply_filters( 'comment_feed_where', $where, $wp_query );
+		}
+
 		if ( $where ) {
 			$where = 'WHERE ' . $where;
 		}
 
+		if ( ! $this->query_vars['suppress_filters'] && is_comment_feed() ) {
+			$groupby = apply_filters( 'comment_feed_groupby', $groupby, $wp_query );
+		}
+
 		if ( $groupby ) {
 			$groupby = 'GROUP BY ' . $groupby;
 		}
 
+		if ( ! $this->query_vars['suppress_filters'] && is_comment_feed() ) {
+			$orderby = apply_filters( 'comment_feed_orderby', $orderby, $wp_query );
+		}
+
 		if ( $orderby ) {
 			$orderby = "ORDER BY $orderby";
 		}
Index: src/wp-includes/query.php
===================================================================
--- src/wp-includes/query.php	(revision 37571)
+++ src/wp-includes/query.php	(working copy)
@@ -3216,73 +3216,21 @@
 
 		// Comments feeds
 		if ( $this->is_comment_feed && ! $this->is_singular ) {
-			if ( $this->is_archive || $this->is_search ) {
-				$cjoin = "JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) $join ";
-				$cwhere = "WHERE comment_approved = '1' $where";
-				$cgroupby = "$wpdb->comments.comment_id";
-			} else { // Other non singular e.g. front
-				$cjoin = "JOIN $wpdb->posts ON ( $wpdb->comments.comment_post_ID = $wpdb->posts.ID )";
-				$cwhere = "WHERE ( post_status = 'publish' OR ( post_status = 'inherit' && post_type = 'attachment' ) ) AND comment_approved = '1'";
-				$cgroupby = '';
-			}
 
-			if ( !$q['suppress_filters'] ) {
-				/**
-				 * Filters the JOIN clause of the comments feed query before sending.
-				 *
-				 * @since 2.2.0
-				 *
-				 * @param string   $cjoin The JOIN clause of the query.
-				 * @param WP_Query &$this The WP_Query instance (passed by reference).
-				 */
-				$cjoin = apply_filters_ref_array( 'comment_feed_join', array( $cjoin, &$this ) );
+			$comment_args = array(
+				'orderby'                   => 'comment_date_gmt',
+				'order'                     => 'DESC',
+				'status'                    => 'approve',
+				'post__in'                  => wp_list_pluck( $this->posts, 'ID' ),
+				'no_found_rows'             => false,
+				'number'                    => get_option( 'posts_per_rss' ),
+				'suppress_filters'          => $q['suppress_filters'],
+				'update_comment_meta_cache' => false, // We lazy-load comment meta for performance.
+			);
 
-				/**
-				 * Filters the WHERE clause of the comments feed query before sending.
-				 *
-				 * @since 2.2.0
-				 *
-				 * @param string   $cwhere The WHERE clause of the query.
-				 * @param WP_Query &$this  The WP_Query instance (passed by reference).
-				 */
-				$cwhere = apply_filters_ref_array( 'comment_feed_where', array( $cwhere, &$this ) );
-
-				/**
-				 * Filters the GROUP BY clause of the comments feed query before sending.
-				 *
-				 * @since 2.2.0
-				 *
-				 * @param string   $cgroupby The GROUP BY clause of the query.
-				 * @param WP_Query &$this    The WP_Query instance (passed by reference).
-				 */
-				$cgroupby = apply_filters_ref_array( 'comment_feed_groupby', array( $cgroupby, &$this ) );
-
-				/**
-				 * Filters the ORDER BY clause of the comments feed query before sending.
-				 *
-				 * @since 2.8.0
-				 *
-				 * @param string   $corderby The ORDER BY clause of the query.
-				 * @param WP_Query &$this    The WP_Query instance (passed by reference).
-				 */
-				$corderby = apply_filters_ref_array( 'comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) );
-
-				/**
-				 * Filters the LIMIT clause of the comments feed query before sending.
-				 *
-				 * @since 2.8.0
-				 *
-				 * @param string   $climits The JOIN clause of the query.
-				 * @param WP_Query &$this   The WP_Query instance (passed by reference).
-				 */
-				$climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
-			}
-			$cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';
-			$corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';
-
-			$comments = (array) $wpdb->get_results("SELECT $distinct $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits");
-			// Convert to WP_Comment
-			$this->comments = array_map( 'get_comment', $comments );
+			$comment_args = apply_filters( 'comments_feed_query_args', $comment_args );
+			$comment_query = new WP_Comment_Query( $comment_args );
+			$this->comments = $comment_query->comments;
 			$this->comment_count = count($this->comments);
 
 			$post_ids = array();
@@ -3635,27 +3583,21 @@
 		}
 
 		if ( !empty($this->posts) && $this->is_comment_feed && $this->is_singular ) {
-			/** This filter is documented in wp-includes/query.php */
-			$cjoin = apply_filters_ref_array( 'comment_feed_join', array( '', &$this ) );
 
-			/** This filter is documented in wp-includes/query.php */
-			$cwhere = apply_filters_ref_array( 'comment_feed_where', array( "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'", &$this ) );
+			$comment_args = array(
+				'orderby'                   => 'comment_date_gmt',
+				'order'                     => 'DESC',
+				'status'                    => 'approve',
+				'post_id'                   => $this->posts[0]->ID,
+				'no_found_rows'             => false,
+				'number'                    => get_option( 'posts_per_rss' ),
+				'update_comment_meta_cache' => false, // We lazy-load comment meta for performance.
+				'suppress_filters'          => $q['suppress_filters'],
+			);
 
-			/** This filter is documented in wp-includes/query.php */
-			$cgroupby = apply_filters_ref_array( 'comment_feed_groupby', array( '', &$this ) );
-			$cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';
-
-			/** This filter is documented in wp-includes/query.php */
-			$corderby = apply_filters_ref_array( 'comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) );
-			$corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';
-
-			/** This filter is documented in wp-includes/query.php */
-			$climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
-
-			$comments_request = "SELECT $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits";
-			$comments = $wpdb->get_results($comments_request);
-			// Convert to WP_Comment
-			$this->comments = array_map( 'get_comment', $comments );
+			$comment_args = apply_filters( 'comments_feed_query_args', $comment_args );
+			$comment_query = new WP_Comment_Query( $comment_args );
+			$this->comments = $comment_query->comments;
 			$this->comment_count = count($this->comments);
 		}
 
